Unidata / netcdf-c

Official GitHub repository for netCDF-C libraries and utilities.
BSD 3-Clause "New" or "Revised" License
512 stars 262 forks source link

Visual Studio issues in `main` development branch #2720

Open WardF opened 1 year ago

WardF commented 1 year ago

Failures observed under Windows using main; these failures are new compared to the v4.9.2 release. The following tests are failing on Windows 10 under Visual Studio 2017.

Failures need to be explored. Output from the failing tests are in the attached file. Does anything immediately leap out at you, @DennisHeimbigner ? I'm still getting a dev environment on Windows 11 with Visual Studio 2022 stood up; I'm seeing weird issues trying to link against libcurl.

DennisHeimbigner commented 1 year ago

Can you post the CMake options you used?

WardF commented 1 year ago

Hi Dennis,

The only options I'm using are

$ cmake .. -DCMAKE_PREFIX_PATH=[path to my local development libraries]

Other than that, default values are used.

DennisHeimbigner commented 1 year ago

Ward- I am building with Visual Studio 2019 community edition. I use the sequence of commands below the dotted line. I should note that I am working in a cygwin environment.

Everything builds and tests ok, including the tests that fail for you, namely:

The CMAKE_IMPORT_LIBRARY option points to where I have built the various support libraries. Note the use of the CURL_NO_CURL_CMAKE option; may be relevant.

NCPWD=`pwd`
NCCYGLIB=$NCPWD/build/liblib
NCCLIB=/cygdrive/c/tools/hdf5-1.10.6/lib
NCCBIN=/cygdrive/c/tools/hdf5-1.10.6/bin
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${NCCYGLIB}:${NCCLIB}:${NCCBIN}"
export PATH="${NCCBIN}:$PATH:$NCCYGLIB:${LD_LIBRARY_PATH}"

rm -fr build
mkdir build
cd build

cmake -DBUILD_SHARED_LIBS=ON -DNC_FIND_SHARED_LIBS=ON -DCMAKE_IMPORT_LIBRARY_PREFIX=c:/tools/hdf5-1.10.6 -DCMAKE_INSTALL_PREFIX=d:/tmp/netcdf -DHDF5_DIR=c:/tools/hdf5-1.10.6/cmake/hdf5 -DCURL_NO_CURL_CMAKE=ON ..
cmake --build . --config Release --target ALL_BUILD
cmake --build . --config Release --target RUN_TESTS
WardF commented 1 year ago

@DennisHeimbigner That is encouraging; I'm using MSYS bash and will test with a CMD command line. I wonder if it is a pathing issue. I'll also install Cygwin and see what results I observe.