Skip to content
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

[netcdf-c] Fix linkage error #14421

Merged
merged 1 commit into from Nov 11, 2020

Conversation

NancyLi1013
Copy link
Contributor

@NancyLi1013 NancyLi1013 commented Nov 6, 2020

Describe the pull request

[139/140] cmd.exe /C "cd . && D:\Dokumenty\Projects\lib\vcpkg\downloads\tools\cmake-3.18.4-windows\cmake-3.18.4-win32-x86\bin\cmake.exe -E vs_link_dll --intdir=liblib\CMakeFiles\netcdf.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx64\x86\link.exe  @CMakeFiles\netcdf.rsp  /out:liblib\netcdf.dll /implib:liblib\netcdf.lib /pdb:liblib\netcdf.pdb /dll /version:18.0 /machine:X86 /LARGEADDRESSAWARE /STACK:40000000 /nologo    /debug /INCREMENTAL  /NODEFAULTLIB:MSVCRT  && cd ."
FAILED: liblib/netcdf.dll liblib/netcdf.lib 
cmd.exe /C "cd . && D:\Dokumenty\Projects\lib\vcpkg\downloads\tools\cmake-3.18.4-windows\cmake-3.18.4-win32-x86\bin\cmake.exe -E vs_link_dll --intdir=liblib\CMakeFiles\netcdf.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100190~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx64\x86\link.exe  @CMakeFiles\netcdf.rsp  /out:liblib\netcdf.dll /implib:liblib\netcdf.lib /pdb:liblib\netcdf.pdb /dll /version:18.0 /machine:X86 /LARGEADDRESSAWARE /STACK:40000000 /nologo    /debug /INCREMENTAL  /NODEFAULTLIB:MSVCRT  && cd ."
LINK Pass 1: command "C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx64\x86\link.exe @CMakeFiles\netcdf.rsp /out:liblib\netcdf.dll /implib:liblib\netcdf.lib /pdb:liblib\netcdf.pdb /dll /version:18.0 /machine:X86 /LARGEADDRESSAWARE /STACK:40000000 /nologo /debug /INCREMENTAL /NODEFAULTLIB:MSVCRT /MANIFEST /MANIFESTFILE:liblib\CMakeFiles\netcdf.dir/intermediate.manifest liblib\CMakeFiles\netcdf.dir/manifest.res" failed (exit code 1120) with the following output:
   Creating library liblib\netcdf.lib and object liblib\netcdf.exp
dinfermodel.c.obj : error LNK2019: unresolved external symbol _MPI_Error_class@8 referenced in function _openmagic
dinfermodel.c.obj : error LNK2019: unresolved external symbol _MPI_File_open@20 referenced in function _openmagic
dinfermodel.c.obj : error LNK2019: unresolved external symbol _MPI_File_close@4 referenced in function _closemagic
dinfermodel.c.obj : error LNK2019: unresolved external symbol _MPI_File_get_size@8 referenced in function _openmagic
dinfermodel.c.obj : error LNK2019: unresolved external symbol _MPI_File_read_at_all@28 referenced in function _readmagic
hdf5file.c.obj : error LNK2019: unresolved external symbol _MPI_Comm_free@4 referenced in function _nc4_close_netcdf4_file
hdf5create.c.obj : error LNK2001: unresolved external symbol _MPI_Comm_free@4
hdf5open.c.obj : error LNK2001: unresolved external symbol _MPI_Comm_free@4
hdf5file.c.obj : error LNK2019: unresolved external symbol _MPI_Info_free@4 referenced in function _nc4_close_netcdf4_file
hdf5create.c.obj : error LNK2001: unresolved external symbol _MPI_Info_free@4
hdf5open.c.obj : error LNK2001: unresolved external symbol _MPI_Info_free@4
hdf5create.c.obj : error LNK2019: unresolved external symbol _MPI_Comm_dup@8 referenced in function _nc4_create_file
hdf5open.c.obj : error LNK2001: unresolved external symbol _MPI_Comm_dup@8
hdf5create.c.obj : error LNK2019: unresolved external symbol _MPI_Info_dup@8 referenced in function _nc4_create_file
hdf5open.c.obj : error LNK2001: unresolved external symbol _MPI_Info_dup@8
hdf5var.c.obj : error LNK2019: unresolved external symbol _MPI_Allreduce@24 referenced in function _NC4_put_vars
liblib\netcdf.dll : fatal error LNK1120: 10 unresolved externals
ninja: build stopped: subcommand failed.

check if hdf5 was built with parallel support, it also requires mpi to build.

Since hdf5 has a dependency of mpi, there is no need to add mpi as one of dependencies for netcdf-c.

I just add mpi to the link libraries.

Note: No feature needs to test.

@NancyLi1013 NancyLi1013 added category:port-bug The issue is with a library, which is something the port should already support info:internal This PR or Issue was filed by the vcpkg team. labels Nov 6, 2020
@JackBoosY JackBoosY added the info:reviewed Pull Request changes follow basic guidelines label Nov 10, 2020
@strega-nil strega-nil merged commit 0abdaf5 into microsoft:master Nov 11, 2020
@strega-nil
Copy link
Contributor

Awesome, thanks Nancy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support info:internal This PR or Issue was filed by the vcpkg team. info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[netcdf-c:x86-windows] link problem - MPI
3 participants