8000 Symbols missing from cgnsdll.dll · Issue #773 · CGNS/CGNS · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Symbols missing from cgnsdll.dll #773

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

Open
brtnfld opened this issue Jul 10, 2024 Discussed in #768 · 2 comments
Open

Symbols missing from cgnsdll.dll #773

brtnfld opened this issue Jul 10, 2024 Discussed in #768 · 2 comments

Comments

@brtnfld
Copy link
Member
brtnfld commented Jul 10, 2024

Discussed in #768

Originally posted by gmic21 June 28, 2024
I have built a CGNS DLL using v4.3.0 and cmake. When I go to link to my program I get missing symbols that existed in prior CGNS version DLL, which I had built with configure and nmake. I have verified the absence of the symbold in the v4.3.0 DLL build and their presence in the prior version DLL build with dependency walker so this is not a calling name issue. The symbols in question are all FORTRAN callable CG_*_F symbols such as CG_NBASES_F, CG_NCOORDS_F, CG_NSECTIONS_F etc.

When I build the CGNS DLL I get the following output in MSVS 2022 project generated by cmake

Build started at 11:49 AM...
1>------ Build started: Project: ZERO_CHECK, Configuration: Release x64 ------
1>1>Checking Build System
2>------ Build started: Project: cgns_f2c (IFORT), Configuration: Release x64 ------
Compiling with Intel® Fortran Compiler Classic 2021.9.0 [Intel(R) 64]...
cgns_f.F90
Creating library...

Build log written to "file://{deleted}/cgns/cgnslib_4.3.0/Release/src/cgns_f2c.dir/Release/BuildLog.htm"
cgns_f2c - 0 error(s), 0 warning(s)
3>------ Build started: Project: cgns_shared, Configuration: Release x64 ------
3>Building Custom Rule {deleted}/cgns/cgnslib_4.3.0/src/CMakeLists.txt
3>cl : command line warning D9002: ignoring unknown option '/fpp'
3>cl : command line warning D9002: ignoring unknown option '/libs:dll'
3>cl : command line warning D9002: ignoring unknown option '/threads'
3>cgns_error.c
3>cgns_internals.c
3>cgns_io.c
3>cgnslib.c
3>cg_hashmap.c
3>ADF_interface.c
3>ADF_internals.c
3>ADFH.c
3>Generating Code...
3>{deleted}\cgns\cgnslib_4.3.0\src\adfh\ADFH.c(2253,1): warning C4700: uninitialized local variable 'bkg' used
3>{deleted}\cgns\cgnslib_4.3.0\src\adfh\ADFH.c(2253,1): warning C4700: uninitialized local variable 'tconv' used
3>{deleted}\cgns\cgnslib_4.3.0\src\adfh\ADFH.c(2342,1): warning C4700: uninitialized local variable 'bkg' used
3>{deleted}\cgns\cgnslib_4.3.0\src\adfh\ADFH.c(2342,1): warning C4700: uninitialized local variable 'tconv' used
3>cl : command line warning D9002: ignoring unknown option '/fpp'
3>cl : command line warning D9002: ignoring unknown option '/libs:dll'
3>cl : command line warning D9002: ignoring unknown option '/threads'
3>cg_ftoc.c
3>cgio_ftoc.c
3>Generating Code...
3> Creating library {deleted}/cgns/cgnslib_4.3.0/Release/src/Release/cgnsdll.lib and object {deleted}/cgns/cgnslib_4.3.0/Release/src/Release/cgnsdll.exp
3>cgns_shared.vcxproj -> {deleted}\cgns\cgnslib_4.3.0\Release\src\Release\cgnsdll.dll
3>Done building project "cgns_shared.vcxproj".
========== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 11:49 AM and took 05.519 seconds ==========

CG_NBASES_F is in cg_ftoc.c and the binding to the FORTRAN call is in cgns_f.F90, both of which get built and, presumably, linked. Here is an image of the cgns_f.obj file being included in the object libraries for the cgns_shared project and the source cg_ftoc.c is there as well.

image

Yet, CG_NBASES_F is not there

image

How could these symbols not be in the resulting DLL?

@brtnfld
Copy link
Member Author
brtnfld commented Jul 10, 2024

We need to move away from calling the C _f wrappers.

I've changed cg_nbases in the F2008 branch to call the C API directly. Can you try this change to see if it at least fixes cg_nbases? If so, we need to do a lot of the same.

@gmic21
Copy link
gmic21 commented Jul 11, 2024

I've hit a snag with this branch that has vexed me. I build with this at the top level directory above src

cmake -G "NMake Makefiles" ^
-D CMAKE_C_COMPILER=icx -D CMAKE_FORTRAN_COMPILER=ifx ^
-D CMAKE_PREFIX_PATH:PATH="{deleted}\cgns\cgnslib_F2008" ^
-D CGNS_ENABLE_FORTRAN:BOOL=ON ^
-D CMAKE_BUILD_TYPE:STRING="Release" ^
-D CGNS_BUILD_SHARED:BOOL=ON ^
-D CGNS_USE_SHARED:BOOL=ON ^
-D CGNS_ENABLE_LEGACY:BOOL=ON ^
-D CGNS_USE_SHARED:BOOL=ON ^
-D CGNS_ENABLE_LFS:BOOL="ON" ^
-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON ^
-D CMAKE_C_FLAGS:STRING="-DH5_BUILT_AS_DYNAMIC_LIB -DUPPERCASE /MD /Qstd=c99" ^
-D CMAKE_Fortran_FLAGS:STRING="-DH5_BUILT_AS_DYNAMIC_LIB -DUPPERCASE /MD -fpp" ^
-D CGNS_ENABLE_TESTS:BOOL=ON ^
-D CGNS_ENABLE_HDF5:BOOL=ON ^
-D CGNS_BUILD_CGNSTOOLS:BOOL=OFF ^
-D HDF5_NEED_ZLIB:BOOL=ON ^
-D HDF5_NEED_SZIP:BOOL=ON ^
-D CGNS_ENABLE_PARALLEL:BOOL=ON^
-S {deleted}\cgns\cgnslib_F2008 ^
-B {deleted}\cgns\cgnslib_F2008\Release
cmake --build Release.

Everything seems to compile fine. I try to compile my application and it cannot find cgnslib_f.h. This makes sense because it was not configured in the src directory. So I run configure in that src dir and that header file gets created. But if I try to rebuild CGNS as above I get a slew compilation errors. Here is a file of the output.

out-withconfigure.txt

I did not have this problem with 4.3.0.

So I punted. I tried simply commenting out the cg_nbases_f INTERFACE definition in cgns_f.F90 and I had to shut off generation of the tests or it complains that it cannot find cg_nbases_f, which gave me a sinking feeling. Sure enough linking with my application still shows that the cg_nbases_f symbol is not found. I tried to capitalize the call in my FORTRAN code, being pretty sure this would not affect anything, and indeed it still does not find the symbol cg_nbases_f.

BTW, on line 1702 column 36 of configure.bat in src directory there is a '.' when there should be a ','. Should I open a separate thread to report this?

@brtnfld brtnfld removed this from v4.5.0 Jan 3, 2025
@brtnfld brtnfld modified the milestones: v4.5.0, v4.6.0 Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0