This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Guy Williams <address@hidden> writes: > Hi Ed, > > Russ helped me with a dumb syntax error (l not I). > > The ./configure, make test, make install all works well now > > However, when I go back to my Absoft Tools GUI and > try to BUILD my code, it successfully compiles and > then trips over during linking with the same problem > ------------------------------------- > ld: Undefined symbols: > _NF_CLOSE > ... > > ./build/ozpom_NetCDF.o reference to undefined _NF_CLOSE > ... > ------------------------------------- > etc > > i suspect i have to compile my code with the appropriate options to > set the environment variables correctly to avoid the "_" problem > > could you tell me how to do this, as my initial attempts have failed > through > inexperience. You are writing fortran code? With the absoft compiler? In that case you shouldn't have to do anything special to get at the fortran function calls. The program src/nf_test/nf_test.f does exactly that. Try looking at the compile command for that (from doing make test, or, on an already built-up codebase, go to the nf_test directory and do "make clean test"). You're compile command certainly has to include the directory where you installed the netcdf library. Perhaps that's the problem. Start with nf_test.f and insert some of your fortran code that calls netcdf. If it works there (and it should, since the tests pass), then you can figure out the difference between it's compilation and your own codes'. When building the fortran library (from C code) the C preprocessor flag -DabsoftFortran is needed, but nothing like that is needed when linking to the fortran code in the library. Incidentally, if you take a look at my message, and the other-builds web page, you'll see that I built with absoft fortran without any patches, and without any FCFLAGS, and everything worked. Do you know the meaning of the compiler flags you are using? I don't, since I don't work with absoft. Let me know if this helps. Thanks! Ed -- Ed Hartnett -- address@hidden