[MacPorts] #29059: ld: symbol(s) not found error when compiling fortran code using netcdf +gcc45 and gcc45 macports install
#29059: ld: symbol(s) not found error when compiling fortran code using netcdf +gcc45 and gcc45 macports install ------------------------------------+--------------------------------------- Reporter: serra@… | Owner: macports-tickets@… Type: defect | Status: new Priority: High | Milestone: Component: ports | Version: 1.9.2 Keywords: netcdf | Port: netcdf ------------------------------------+--------------------------------------- Hi, I have installed gcc45 and netcdf +gcc45 on a mac running 10.5.8 and have tested the install on a simple fortran code which calls the netcdf library. When I compile this code I get the error: [cassava:~] serra% gfortran -I/opt/local/include handle_err.f -o handle_err -L/opt/local/lib -lnetcdf Undefined symbols: "_main", referenced from: start in crt1.10.5.o "_nf_strerror_", referenced from: _handle_err_ in ccJcyNUi.o ld: symbol(s) not found collect2: ld returned 1 exit status I've had trouble before with macports netcdf libs not working with fortran and ended up creating my own Portfile. But that installation will not work any more. I think because I upgraded all my macports code and hdf5 is now hdf5-18. I did try to fix the problem by installing hdf5-18 +gcc45 and then reinstalling netcdf but this did not fix the problem. I rely on the netcdf libraries every day in my work so desperately need to fix this issue! Thanks. -- Ticket URL: <https://trac.macports.org/ticket/29059> MacPorts <http://www.macports.org/> Ports system for Mac OS
#29059: ld: symbol(s) not found error when compiling fortran code using netcdf +gcc45 and gcc45 macports install ------------------------------------+--------------------------------------- Reporter: serra@… | Owner: takeshi@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.2 Keywords: | Port: netcdf ------------------------------------+--------------------------------------- Changes (by jmr@…): * owner: macports-tickets@… => takeshi@… * keywords: netcdf => * priority: High => Normal Old description:
Hi,
I have installed gcc45 and netcdf +gcc45 on a mac running 10.5.8 and have tested the install on a simple fortran code which calls the netcdf library. When I compile this code I get the error:
[cassava:~] serra% gfortran -I/opt/local/include handle_err.f -o handle_err -L/opt/local/lib -lnetcdf Undefined symbols: "_main", referenced from: start in crt1.10.5.o "_nf_strerror_", referenced from: _handle_err_ in ccJcyNUi.o ld: symbol(s) not found collect2: ld returned 1 exit status
I've had trouble before with macports netcdf libs not working with fortran and ended up creating my own Portfile. But that installation will not work any more. I think because I upgraded all my macports code and hdf5 is now hdf5-18. I did try to fix the problem by installing hdf5-18 +gcc45 and then reinstalling netcdf but this did not fix the problem.
I rely on the netcdf libraries every day in my work so desperately need to fix this issue!
Thanks.
New description: Hi, I have installed gcc45 and netcdf +gcc45 on a mac running 10.5.8 and have tested the install on a simple fortran code which calls the netcdf library. When I compile this code I get the error: {{{ [cassava:~] serra% gfortran -I/opt/local/include handle_err.f -o handle_err -L/opt/local/lib -lnetcdf Undefined symbols: "_main", referenced from: start in crt1.10.5.o "_nf_strerror_", referenced from: _handle_err_ in ccJcyNUi.o ld: symbol(s) not found collect2: ld returned 1 exit status }}} I've had trouble before with macports netcdf libs not working with fortran and ended up creating my own Portfile. But that installation will not work any more. I think because I upgraded all my macports code and hdf5 is now hdf5-18. I did try to fix the problem by installing hdf5-18 +gcc45 and then reinstalling netcdf but this did not fix the problem. I rely on the netcdf libraries every day in my work so desperately need to fix this issue! Thanks. -- Comment: Please remember to cc the maintainer. As per the ticket guidelines, the High priority is reserved for the use of MacPorts team members. -- Ticket URL: <https://trac.macports.org/ticket/29059#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#29059: ld: symbol(s) not found error when compiling fortran code using netcdf +gcc45 and gcc45 macports install ------------------------------------+--------------------------------------- Reporter: serra@… | Owner: takeshi@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.2 Keywords: | Port: netcdf ------------------------------------+--------------------------------------- Comment(by takeshi@…): You need to link against the netcdf fortran library. {{{ $ nc-config --flibs -L/opt/local/lib -lnetcdff -lnetcdf }}} -- Ticket URL: <https://trac.macports.org/ticket/29059#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#29059: netcdf: ld: symbol(s) not found error when compiling fortran code using netcdf +gcc45 and gcc45 macports install ------------------------------------+--------------------------------------- Reporter: serra@… | Owner: takeshi@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.2 Keywords: | Port: netcdf ------------------------------------+--------------------------------------- Comment(by ryandesign@…): Is there a bug here that we need to fix or can we close this ticket? -- Ticket URL: <https://trac.macports.org/ticket/29059#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#29059: netcdf: ld: symbol(s) not found error when compiling fortran code using netcdf +gcc45 and gcc45 macports install -------------------------------------+-------------------------------------- Reporter: serra@… | Owner: takeshi@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 1.9.2 Resolution: invalid | Keywords: Port: netcdf | -------------------------------------+-------------------------------------- Changes (by takeshi@…): * status: new => closed * resolution: => invalid -- Ticket URL: <https://trac.macports.org/ticket/29059#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts