Vikram,

This looks like the same issue I ran into. Are you trying to build static 
libraries? If so, you either need to downgrade your to CMake 3.8.2 or use the 
attached patch (HDFFV-10334).

https://cmake.org/pipermail/cmake/2017-December/066736.html

Attached is a patch (fix-windows-static-fortran.diff) to fix compiling static 
Fortran libraries on Windows.  When you replace
UserMacros.cmake with config\cmake\UserMacros\Windows_MT.cmake. The macro gets 
called before Fortran is enabled.
So, all the Fortran compile flags are empty. The macro needs to be invoked 
after enable_language(Fortran).

With camke < 3.9 you could still compile the code with the mixed runtime 
libraries. With cmake > 3.9 the linking will
fail for FortranCInterface and never give you a sln/nmake/ninja config.

[46/46] Linking Fortran executable FortranCInterface.exe
FAILED: FortranCInterface.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe 
--intdir=CMakeFiles\FortranCInterface.dir --manifests  -- xilink /nologo 
CMakeFiles\FortranCInterface.dir\main.F.obj 
CMakeFiles\FortranCInterface.dir\call_sub.f.obj 
CMakeFiles\FortranCInterface.dir\call_mod.f90.obj  /out:FortranCInterface.exe 
/implib:FortranCInterface.lib /pdb:FortranCInterface.pdb /version:0.0  
/machine:x64 /INCREMENTAL:NO /subsystem:console  symbols.lib myfort.lib 
user32.lib && cd ."
xilink: executing 'link'
LIBCMT.lib(winapisupp.obj) : error LNK2005: __crtSetUnhandledExceptionFilter 
already defined in MSVCRT.lib(MSVCR120.dll)
LIBCMT.lib(crtheap.obj) : error LNK2005: _calloc_crt already defined in 
MSVCRT.lib(MSVCR120.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: _amsg_exit already defined in 
MSVCRT.lib(MSVCR120.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: _cexit already defined in 
MSVCRT.lib(MSVCR120.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in 
MSVCRT.lib(MSVCR120.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: _initterm_e already defined in 
MSVCRT.lib(MSVCR120.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: exit already defined in 
MSVCRT.lib(MSVCR120.dll)
LIBCMT.lib(mlock.obj) : error LNK2005: _lock already defined in 
MSVCRT.lib(MSVCR120.dll)
LIBCMT.lib(mlock.obj) : error LNK2005: _unlock already defined in 
MSVCRT.lib(MSVCR120.dll)
LIBCMT.lib(winxfltr.obj) : error LNK2005: _XcptFilter already defined in 
MSVCRT.lib(MSVCR120.dll)
LIBCMT.lib(wsetloca.obj) : error LNK2005: _configthreadlocale already defined 
in MSVCRT.lib(MSVCR120.dll)
LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" 
(?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR120.dll)
LIBCMT.lib(crt0init.obj) : error LNK2005: __xi_a already defined in 
MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: __xi_z already defined in 
MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: __xc_a already defined in 
MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: __xc_z already defined in 
MSVCRT.lib(cinitexe.obj)
LIBCMT.lib(errmode.obj) : error LNK2005: __set_app_type already defined in 
MSVCRT.lib(MSVCR120.dll)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; 
use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; 
use /NODEFAULTLIB:library
FortranCInterface.exe : fatal error LNK1169: one or more multiply defined 
symbols found
LINK failed. with 1169

--Christian


From: Hdf-forum <hdf-forum-boun...@lists.hdfgroup.org> on behalf of 
"Bhamidipati, Vikram" <vikram.bhamidip...@swri.org>
Reply-To: HDF Users Discussion List <hdf-forum@lists.hdfgroup.org>
Date: Thursday, January 4, 2018 at 6:49 PM
To: "hdf-forum@lists.hdfgroup.org" <hdf-forum@lists.hdfgroup.org>
Subject: [Hdf-forum] HDF5 1.8.20 configuration failed - need help diagnosing 
cause

I am trying to configure and build HDF5 library with CMake 3.10.1 ctest binary 
on a Windows 8.1 machine. When I try configuring I get the following output 
with failure to configure:


loading initial cache file 
C:/darwin_devel/HDF5_source/CMake-hdf5-1.8.20/CMake-hdf5-1.8.20\hdf5-1.8.20/config/cmake/cacheinit.cmake
-- The C compiler identification is MSVC 18.0.40629.0
-- The CXX compiler identification is MSVC 18.0.40629.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 
12.0/VC/bin/x86_amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 
12.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual 
Studio 12.0/VC/bin/x86_amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual 
Studio 12.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- SOVERSION: 10.3.1
-- SOVERSION_TOOLS: 10.0.6
-- SOVERSION_CXX: 15.0.0
-- SOVERSION_F: 10.0.5
-- SOVERSION_HL: 10.2.1
-- SOVERSION_HL_CXX: 11.1.1
-- SOVERSION_HL_F: 10.0.4
-- Check for STD namespace
-- Check for STD namespace - found
-- Looking for gethostname in ucb;
-- Looking for gethostname in ucb; - not found
-- Performing Other Test STDC_HEADERS - Success
-- Looking for include files windows.h, sys/file.h
-- Looking for include files windows.h, sys/file.h - not found
-- Looking for include files windows.h, sys/ioctl.h
-- Looking for include files windows.h, sys/ioctl.h - not found
-- Looking for include files windows.h, sys/resource.h
-- Looking for include files windows.h, sys/resource.h - not found
-- Looking for include files windows.h, sys/socket.h
-- Looking for include files windows.h, sys/socket.h - not found
-- Looking for 3 include files windows.h, ..., sys/time.h
-- Looking for 3 include files windows.h, ..., sys/time.h - not found
-- Looking for 4 include files windows.h, ..., features.h
-- Looking for 4 include files windows.h, ..., features.h - not found
-- Looking for 4 include files windows.h, ..., dirent.h
-- Looking for 4 include files windows.h, ..., dirent.h - not found
-- Looking for 4 include files windows.h, ..., setjmp.h
-- Looking for 4 include files windows.h, ..., setjmp.h - found
-- Looking for 6 include files windows.h, ..., stdint.h
-- Looking for 6 include files windows.h, ..., stdint.h - found
-- Looking for 7 include files windows.h, ..., unistd.h
-- Looking for 7 include files windows.h, ..., unistd.h - not found
-- Looking for C++ include stdint.h
-- Looking for C++ include stdint.h - found
-- Looking for 7 include files windows.h, ..., mach/mach_time.h
-- Looking for 7 include files windows.h, ..., mach/mach_time.h - not found
-- Looking for 7 include files windows.h, ..., io.h
-- Looking for 7 include files windows.h, ..., io.h - found
-- Looking for 8 include files windows.h, ..., winsock2.h
-- Looking for 8 include files windows.h, ..., winsock2.h - found
-- Looking for 9 include files windows.h, ..., sys/timeb.h
-- Looking for 9 include files windows.h, ..., sys/timeb.h - found
-- Looking for 10 include files windows.h, ..., globus/common.h
-- Looking for 10 include files windows.h, ..., globus/common.h - not found
-- Looking for 10 include files windows.h, ..., pdb.h
-- Looking for 10 include files windows.h, ..., pdb.h - not found
-- Looking for 10 include files windows.h, ..., pthread.h
-- Looking for 10 include files windows.h, ..., pthread.h - not found
-- Looking for 10 include files windows.h, ..., srbclient.h
-- Looking for 10 include files windows.h, ..., srbclient.h - not found
-- Looking for 10 include files windows.h, ..., string.h
-- Looking for 10 include files windows.h, ..., string.h - found
-- Looking for 11 include files windows.h, ..., strings.h
-- Looking for 11 include files windows.h, ..., strings.h - not found
-- Looking for 11 include files windows.h, ..., stdlib.h
-- Looking for 11 include files windows.h, ..., stdlib.h - found
-- Looking for 12 include files windows.h, ..., memory.h
-- Looking for 12 include files windows.h, ..., memory.h - found
-- Looking for 13 include files windows.h, ..., dlfcn.h
-- Looking for 13 include files windows.h, ..., dlfcn.h - not found
-- Looking for 13 include files windows.h, ..., inttypes.h
-- Looking for 13 include files windows.h, ..., inttypes.h - found
-- Looking for 14 include files windows.h, ..., netinet/in.h
-- Looking for 14 include files windows.h, ..., netinet/in.h - not found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of char
-- Check size of char - done
-- Check size of short
-- Check size of short - done
-- Check size of int
-- Check size of int - done
-- Check size of unsigned
-- Check size of unsigned - done
-- Check size of long
-- Check size of long - done
-- Check size of long long
-- Check size of long long - done
-- Check size of __int64
-- Check size of __int64 - done
-- Check size of float
-- Check size of float - done
-- Check size of double
-- Check size of double - done
-- Check size of long double
-- Check size of long double - done
-- Check size of int8_t
-- Check size of int8_t - done
-- Check size of uint8_t
-- Check size of uint8_t - done
-- Check size of int_least8_t
-- Check size of int_least8_t - done
-- Check size of uint_least8_t
-- Check size of uint_least8_t - done
-- Check size of int_fast8_t
-- Check size of int_fast8_t - done
-- Check size of uint_fast8_t
-- Check size of uint_fast8_t - done
-- Check size of int16_t
-- Check size of int16_t - done
-- Check size of uint16_t
-- Check size of uint16_t - done
-- Check size of int_least16_t
-- Check size of int_least16_t - done
-- Check size of uint_least16_t
-- Check size of uint_least16_t - done
-- Check size of int_fast16_t
-- Check size of int_fast16_t - done
-- Check size of uint_fast16_t
-- Check size of uint_fast16_t - done
-- Check size of int32_t
-- Check size of int32_t - done
-- Check size of uint32_t
-- Check size of uint32_t - done
-- Check size of int_least32_t
-- Check size of int_least32_t - done
-- Check size of uint_least32_t
-- Check size of uint_least32_t - done
-- Check size of int_fast32_t
-- Check size of int_fast32_t - done
-- Check size of uint_fast32_t
-- Check size of uint_fast32_t - done
-- Check size of int64_t
-- Check size of int64_t - done
-- Check size of uint64_t
-- Check size of uint64_t - done
-- Check size of int_least64_t
-- Check size of int_least64_t - done
-- Check size of uint_least64_t
-- Check size of uint_least64_t - done
-- Check size of int_fast64_t
-- Check size of int_fast64_t - done
-- Check size of uint_fast64_t
-- Check size of uint_fast64_t - done
-- Check size of size_t
-- Check size of size_t - done
-- Check size of ssize_t
-- Check size of ssize_t - failed
-- Check size of off_t
-- Check size of off_t - done
-- Check size of off64_t
-- Check size of off64_t - failed
-- Looking for 14 include files windows.h, ..., stdbool.h
-- Looking for 14 include files windows.h, ..., stdbool.h - found
-- Check size of _Bool
-- Check size of _Bool - done
-- Looking for alarm
-- Looking for alarm - not found
-- Looking for fcntl
-- Looking for fcntl - not found
-- Looking for flock
-- Looking for flock - not found
-- Looking for fork
-- Looking for fork - not found
-- Looking for frexpf
-- Looking for frexpf - not found
-- Looking for frexpl
-- Looking for frexpl - not found
-- Looking for getrusage
-- Looking for getrusage - not found
-- Looking for llround
-- Looking for llround - found
-- Looking for llroundf
-- Looking for llroundf - found
-- Looking for lround
-- Looking for lround - found
-- Looking for lroundf
-- Looking for lroundf - found
-- Looking for lstat
-- Looking for lstat - not found
-- Looking for rand_r
-- Looking for rand_r - not found
-- Looking for random
-- Looking for random - not found
-- Looking for round
-- Looking for round - found
-- Looking for roundf
-- Looking for roundf - found
-- Looking for setsysinfo
-- Looking for setsysinfo - not found
-- Looking for signal
-- Looking for signal - found
-- Looking for setjmp
-- Looking for setjmp - found
-- Looking for siglongjmp
-- Looking for siglongjmp - not found
-- Looking for sigsetjmp
-- Looking for sigsetjmp - not found
-- Looking for sigprocmask
-- Looking for sigprocmask - not found
-- Looking for snprintf
-- Looking for snprintf - not found
-- Looking for srandom
-- Looking for srandom - not found
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for strtoull
-- Looking for strtoull - found
-- Looking for symlink
-- Looking for symlink - not found
-- Looking for tmpfile
-- Looking for tmpfile - found
-- Looking for asprintf
-- Looking for asprintf - not found
-- Looking for vasprintf
-- Looking for vasprintf - not found
-- Looking for waitpid
-- Looking for waitpid - not found
-- Looking for vsnprintf
-- Looking for vsnprintf - found
-- Looking for sigsetjmp
-- Looking for sigsetjmp - not found
-- Performing CXX Test OLD_HEADER_FILENAME - Failed
-- Performing CXX Test H5_NO_NAMESPACE - Failed
-- Performing CXX Test H5_NO_STD - Failed
-- Performing CXX Test BOOL_NOTDEFINED - Failed
-- Performing CXX Test NO_STATIC_CAST - Failed
-- Performing CXX Test CXX_HAVE_OFFSETOF - Failed
-- Checking for InitOnceExecuteOnce:
-- Performing Test InitOnceExecuteOnce - Success
-- Performing Other Test HAVE_INLINE - Failed
-- Performing Other Test HAVE___INLINE__ - Failed
-- Performing Other Test HAVE___INLINE - Success
-- Checking for appropriate format for 64 bit long:
-- Checking for appropriate format for 64 bit long: found "I64"
-- Looking for difftime
-- Looking for difftime - found
-- Checking IF your system converts long double to (unsigned) long values with 
special algorithm... no
-- Checking IF your system can convert (unsigned) long to long double values 
with special algorithm... no
-- Checking IF correctly converting long double to (unsigned) long long 
values... yes
-- Checking IF correctly converting (unsigned) long long to long double 
values... yes
-- Checking IF alignment restrictions are strictly enforced... yes
-- Filter ZLIB is built
-- Filter ZLIB is ON
-- Filter SZIP is built
-- Filter SZIP is ON
-- The Fortran compiler identification is Intel 15.0.6.20151119
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/Composer XE 
2015/bin/intel64/ifort.exe
-- Check for working Fortran compiler: C:/Program Files (x86)/Intel/Composer XE 
2015/bin/intel64/ifort.exe  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Determine Intel Fortran Compiler Implicit Link Path
-- Determine Intel Fortran Compiler Implicit Link Path -- done
-- Checking whether C:/Program Files (x86)/Intel/Composer XE 
2015/bin/intel64/ifort.exe supports Fortran 90
-- Checking whether C:/Program Files (x86)/Intel/Composer XE 
2015/bin/intel64/ifort.exe supports Fortran 90 -- yes
-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Failed to compile
CMake Error at config/cmake_ext_mod/HDFUseFortran.cmake:29 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  CMakeLists.txt:764 (include)


CMake Error at config/cmake_ext_mod/HDFUseFortran.cmake:33 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  CMakeLists.txt:764 (include)


-- Testing Fortran sizeof
-- Testing Fortran sizeof - OK
-- Testing Fortran c_sizeof
-- Testing Fortran c_sizeof - OK
-- Testing Fortran storage_size
-- Testing Fortran storage_size - OK
-- Testing Fortran ISO_FORTRAN_ENV
-- Testing Fortran ISO_FORTRAN_ENV - OK
-- Testing Fortran RealIsNotDouble
-- Testing Fortran RealIsNotDouble - OK
-- Testing Fortran iso_c_binding
-- Testing Fortran iso_c_binding - OK
-- Configuring incomplete, errors occurred!
See also 
"C:/darwin_devel/HDF5_source/CMake-hdf5-1.8.20/CMake-hdf5-1.8.20/build/CMakeFiles/CMakeOutput.log".
See also 
"C:/darwin_devel/HDF5_source/CMake-hdf5-1.8.20/CMake-hdf5-1.8.20/build/CMakeFiles/CMakeError.log".

I ran the ctest command as described on the website with minor edit to create 
FORTRAN libraries. My batch command is as follows:
“ctest -S HDF5config.cmake,FORTRAN_LIBRARIES=YES,BUILD_GENERATOR=VS201364 -C 
Release -VV -O hdf5.log”

The error (highlighted in red font above) seems to be due to some regex match 
command not being as expected. What am I doing wrong?

Thank you,
Vikram
--------------------------------------------------
Computational Materials Integrity
Materials Engineering Department
Southwest Research Institute
210-522-2576


________________________________

The information contained in this email message, including any attachments, 
contains or may contain proprietary and confidential information intended only 
for the addressee. It is furnished with the understanding that it is for the 
sole use of the addressee and may only be used for the purposes for which it 
has been delivered by Studsvik or its designee. The information contained 
herein shall not be copied, reproduced or transmitted to any other parties, nor 
shall it be used for any other purpose, without prior written consent of 
Studsvik. If you have received this email in error, please return it to the 
sender and destroy or otherwise permanently delete the copy received.

Attachment: fix-windows-static-fortran.diff
Description: fix-windows-static-fortran.diff

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Reply via email to