Opened 8 years ago

Closed 8 years ago

#49651 closed defect (wontfix)

nco @4.5.2_2: /opt/local/include/antlr/CharScanner.hpp:565:41: error: 'strcasecmp' was not declared in this scope

Reported by: almage (Roy Miller) Owned by: tenomoto (Takeshi Enomoto)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc: thiagoveloso (Thiago V. dos Santos), massonseb
Port: nco

Description

It appears that the nco build fails due to an issue in the ncoLexer, due to an issue in the antlr port CharScanner.hpp "strcasecmp" routine, if I'm reading the main.log properly.

I believe the issue is shown in this main.log excerpt:

:info:build /opt/local/bin/g++-mp-4.9 -DHAVE_CONFIG_H -I. -I../..  -I./ -I../nco -I/opt/local/include -I/opt/local/include -DNDEBUG -I/opt/local/include -I/usr/include/malloc -I/opt/local/include/udunits2 -I/opt/local/include -DENABLE_NETCDF4 -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/opt/local/include/udunits2  -pipe -Os -c -o ncoParser.o ncoParser.cpp
:info:build In file included from ncoLexer.hpp:10:0,
:info:build                  from ncoLexer.cpp:2:
:info:build /opt/local/include/antlr/CharScanner.hpp: In member function 'bool antlr::CharScannerLiteralsLess::operator()(const string&, const string&) const':
:info:build /opt/local/include/antlr/CharScanner.hpp:565:41: error: 'strcasecmp' was not declared in this scope
:info:build    return (strcasecmp(x.c_str(),y.c_str())<0);
:info:build                                          ^
:info:build /opt/local/bin/g++-mp-4.9 -DHAVE_CONFIG_H -I. -I../..  -I./ -I../nco -I/opt/local/include -I/opt/local/include -DNDEBUG -I/opt/local/include -I/usr/include/malloc -I/opt/local/include/udunits2 -I/opt/local/include -DENABLE_NETCDF4 -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/opt/local/include/udunits2  -pipe -Os -c -o ncoTree.o ncoTree.cpp
:info:build make[3]: *** [fmc_gsl_cls.o] Error 1
:info:build make[3]: *** Waiting for unfinished jobs....
:info:build make[3]: *** [ncoLexer.o] Error 1
:info:build make[3]: Leaving directory 

Attachments (2)

nco-4.5.2_2_main.log (173.2 KB) - added by almage (Roy Miller) 8 years ago.
the main.log from /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_science_nco/nco/main.log
main.log (182.2 KB) - added by tenomoto (Takeshi Enomoto) 8 years ago.
main-takeshi-link-error.log

Download all attachments as: .zip

Change History (9)

Changed 8 years ago by almage (Roy Miller)

Attachment: nco-4.5.2_2_main.log added

the main.log from /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_science_nco/nco/main.log

comment:1 in reply to:  description Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to gryphon.csd8@…:

It appears that the nco build fails due to an issue in the ncoLexer, due to an issue in the antlr port CharScanner.hpp "strcasecmp" routine, if I'm reading the main.log properly.

Almost right: strcasecmp is an operating system function, which for some reason is not being found.

comment:2 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to takeshi@…

comment:3 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: thiagoveloso@… added

Has duplicate #49754.

comment:4 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: smasson@… added
Summary: nco @4.5.2_2 +gcc49 build failurenco @4.5.2_2: /opt/local/include/antlr/CharScanner.hpp:565:41: error: 'strcasecmp' was not declared in this scope

Has duplicate #50793.

Changed 8 years ago by tenomoto (Takeshi Enomoto)

Attachment: main.log added

main-takeshi-link-error.log

comment:5 Changed 8 years ago by tenomoto (Takeshi Enomoto)

It seems that clang++ can compile ncoLexer.cpp but g++. I was able to compile ncoLexer.cpp by patching CharScanner.hpp. But I still have link errors.

comment:6 Changed 8 years ago by tenomoto (Takeshi Enomoto)

clang++ used to compile antlr and g++ seems to generate different symbols. e.g. for antlr::ASTFactory::create

$ nm work/nco-4.5.5/src/nco++/ncoParser.o | grep ASTFactory | grep create
                 U __ZN5antlr10ASTFactory6createENS_13TokenRefCountINS_5TokenEEE
                 U __ZN5antlr10ASTFactory6createEiRKSs
$ nm /opt/local/lib/libantlr.a | grep ASTFactory | grep create
000000000000049c T __ZN5antlr10ASTFactory6createENS_11ASTRefCountINS_3ASTEEE
0000000000000588 T __ZN5antlr10ASTFactory6createENS_13TokenRefCountINS_5TokenEEE
0000000000000396 T __ZN5antlr10ASTFactory6createEi
0000000000000432 T __ZN5antlr10ASTFactory6createEiRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE
0000000000000344 T __ZN5antlr10ASTFactory6createEv

comment:7 Changed 8 years ago by tenomoto (Takeshi Enomoto)

Resolution: wontfix
Status: newclosed

I simply disabled ncap2 when compiled with gcc in r146325. I added a patch to antlr in r146324. If someone let me know how to fix the symbol problem, I'll enable ncap2 again for gcc.

Note: See TracTickets for help on using tickets.