-
Notifications
You must be signed in to change notification settings - Fork 106
Undefined References #828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I don't see where you've linked in the cgns library. What build system is FUN3d using? I would look at the Makefiles/CMakefile in the examples/tests to see how linking/including is done and do the same in FUN3D. Otherwise, you should be able to build CGNS with verbose on to get the include/libraries specified on the compile line from the tests and examples. |
I am linking to CGNS using a --with-cgns= flag in my configure script for FUN3D. The build system is a configure script followed by a make and make install if that's what you're asking. Can provide more details tonight. I do have the CGNS installed in my .local folder and it has its files in the lib and include directories. |
For example, you should have -I, and lib/libcgns.a and a link to libhdf5.so, and maybe some compression libraries, depending on how hdf5 was built. I've not built FUN3D, so I'm unsure why it does not link the libraries correctly. This is my command for building a fortran example:
|
I'm not sure what you mean by linking the CGNS library, but here's what I'm doing before I run the configure script with the --with-cgns link: export CXX=icpx I tried putting an include directory under FCFLAGS that went to the lcgns but it didn't seem to work. |
Also just tried implementing something similar to what you described and it didn't appear to work. HDF5 for me is installed by default on my cluster and doesn't have parallel support I believe. Would you suggest incorporating the -lm, -ldl, -lz flags? |
Did it have the same error as before? Can you give the full compile line that fails? Can you list the contents of your lib directory? When you installed cgns, did you use the system HDF5? I assume you want to do parallel IO, so you might need to compile HDF5. |
Yes -- here is the full compile line: And here are the contents of the lib directory: I did indeed build using the system HDF5. Could it be the fact HDF5 wasn't parallel that caused this? Is there a way to compile HDF5 that overrides whats on my HPC? I don't have admin privileges on it. |
Since it is using cg_open, it is not using the CGNS parallel routines, so it is ok that HDF5 does not have parallel enabled. Did you disable parallel when building CGNS? If you do You should also use the same Fortran compiler to build CGNS and your application. Did you run a make test for your CGNS install? Otherwise, it is unclear what the issue is since you are linking in the CGNS library. |
I'm not sure what you mean by doing nm but I did this command: ~/Dependencies/CGNS-develop$ nm When I run make I get this: /Dependencies/CGNS-develop/src/build2$ make |
I did some more digging and found that cg_open_f does exist in my library: This leaves it to be some sort of syncing issue I'd presume. Is there a way to test CGNS like you described? I tried make test and ctest in my build folder but neither seem to work. |
What errors are you seeing for the CGNS tests when you do |
Where can I find the tests? I'm trying to run it in a few different places in my build folder and get: |
Did you use build option |
I'm trying to configure FUN3D with CGNS and have the following error when I build:
ent_core -levent_pthreads -L/home/.../FUN3D/nvidia/x86_64/v100/lib -lfluda -L/usr/local/pkg/cuda/cuda-12.6/lib64 -lcudart -lstdc++ -lm -Wl,-rpath -Wl,/usr/local/pkg/openmpi/4.1.5_ucx1170/lib -Wl,-rpath -Wl,/usr/local/pkg/openmpi/4.1.5_ucx1170/lib
/usr/bin/ld: aflr3_to_cgns.o: in function 'MAIN__':
/home/.../FUN3D/fun3d_intg-14.1-6e82beb/build-v101/fun3d/utils/../../../fun3d/utils/aflr3_to_cgns.f90:352: undefined reference to `cg_open_f'
/usr/bin/ld: /home/.../FUN3D/fun3d_intg-14.1-6e82beb/build-v101/fun3d/utils/../../../fun3d/utils/aflr3_to_cgns.f90:361: undefined reference to `cg_base_write_f'
/usr/bin/ld: /home/.../FUN3D/fun3d_intg-14.1-6e82beb/build-v101/fun3d/utils/../../../fun3d/utils/aflr3_to_cgns.f90:371: undefined reference to `cg_zone_write_f'
collect2: error: ld returned 1 exit status
make[6]: *** [Makefile:1565: aflr3_to_cgns] Error 1
make[6]: Leaving directory '/home/.../FUN3D/fun3d_intg-14.1-6e82beb/_build-v101/fun3d/utils'
make[5]: *** [Makefile:1870: all-recursive] Error 1
make[5]: Leaving directory '/home/.../FUN3D/fun3d_intg-14.1-6e82beb/_build-v101/fun3d/utils'
make[4]: *** [Makefile:1423: all] Error 2
All I've dealt with previously is that I had changed some variables from UserDefined and NULL to CG_UserDefined and CG_NULL with the following command:
find . -type f -name "*.F90" -exec sed -i 's/\bUserDefined\b/CG_UserDefined/g; s/\bNULL\b/CG_NULL/g' {} +
I'm not sure which step to take next -- thank you.
The text was updated successfully, but these errors were encountered: