Megan 2,1 install error, cannot find -lioapi

I’m trying to install Megan v2.1 and met this error when I used ‘./make_all_programs.scr 64bit’


it said cannot find -lioapi, also 'underfiend reference to ‘ncaaptc’, I install netcdf using gfortran, but use pgf90 to install Megan. The ioapi package is installed successfully with pgf90. attached is full outpout of the command
output.txt (36.7 KB)

Thank you for your help in advance.

I figure out the error ‘cannot find -lioapi’, it’s because of my ioapi package isn’t install correctly and the system can’t find it, I re-install and solve it. But still have errors like 'undefined reference to ‘ncvdef_’, ‘ncaptc_’. I guess it’s some related to netcdf package. I created symbolic links of libnetcdff.a and libnetcdf.a when I install ioapi package. Is it possible that it is because I installed netcdf (gcc) and ioapi package (pgf90) with a different compiler? Thank you in advance for any suggestions.

lol, it’s actually a simple problem , I don’t add “-lnetcdff” to link flags from MEGAN, after add ‘-lnetcdff -lnetcdf’ in LIBS, I success install Megan

Dear nenghan

I’m sorry that I can’t help you in this problem, because I didn’t successfully run the MEGAN model. Maybe it’s a feasible solution to look for some help from the develop team of MEGAN.

Hope your problem would be addressed soon.

1 Like

What I/O API and netCDF versions? I think you are using an obsolete version of the first, and a newer version of the last.

See https://cjcoats.github.io/ioapi/AVAIL.html#ncf4:

Evidently, starting with netCDF-Fortran 4.4.2, UCAR in their wisdom decided to silently eliminate the CALL NC*() Fortran interfaces in terms of which the I/O API was originally implemented. [If you can find any documentation indicating this intent on the web, I would enjoy seeing it; I can’t find it.]
I/O API Version 3.2 was tediously re-coded to replace all 943 of these calls by the newer IERR=NF_*() Fortran interfaces that are still supported. Prior editions of the I/O API will have link errors with netCDF-Fortran 4.4.2 or later, because routines such as NCCLOS() are no longer in that library.

That undefined reference to ‘ncvdef_ sounds exactly like that problem. Upgrade to the current I/O API 3.2 (and make sure you use -lnetcdff -lnetcdf).

Thank you for this notice, I use I/O API 3.1, netcdf-c-4.7.2 and netcdf- fortran-4.5.2, but I don’t find error when I install Megan using the I/O API 3.1.