Skip to content

Commit

Permalink
updates for Visual Studio/Windows build (#262)
Browse files Browse the repository at this point in the history
* updates for Visual Studio/Windows build

use JAVA_HOME instead of hardcode
use IFORT_COMPILER_LIB instead of version specific
update Readme.md
drop win32\zlibstatic.lib

* drop dss-test-data dir

* update readme to include test steps for Windows
  • Loading branch information
ktarbet authored Dec 31, 2024
1 parent 928e9d4 commit 1bf6852
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 17 deletions.
35 changes: 28 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ zlib, math, quadmath, and gfortran for pydsstools to work in Ubuntu.
```
git clone https://github.com/HydrologicEngineeringCenter/hec-dss.git
cd hec-dss
rm -fr ./dss-test-data
git clone https://github.com/HydrologicEngineeringCenter/dss-test-data.git
In the hec-dss/heclib directory, execute make clean ; make
In the hec-dss/test/C directory, execute ./unix_test
Expand All @@ -70,20 +69,42 @@ export JAVA_HOME=/usr/jdk/instances/jdk1.8.0
export LD_LIBRARY_PATH=/usr/gcc/7/lib/sparcv9

```
1. bash
2. git clone -j2 --recurse-submodules https://github.com/HydrologicEngineeringCenter/hec-dss.git
3. In the hec-dss/heclib directory, execute gmake clean ; gmake
4. In the hec-dss/test/C directory, execute ./unix_test
5. In the hec-dss/test/Dss-C directory, execute gmake clean ; gmake test
6. In the hec-dss/test/Fortran directory, execute gmake -f Makefile.Solaris clean ; gmake -f Makefile.Solaris test
bash
git clone https://github.com/HydrologicEngineeringCenter/hec-dss.git
cd hec-dss
git clone https://github.com/HydrologicEngineeringCenter/dss-test-data.git
In the hec-dss/heclib directory, execute gmake clean ; gmake
In the hec-dss/test/C directory, execute ./unix_test
In the hec-dss/test/Dss-C directory, execute gmake clean ; gmake test
In the hec-dss/test/Fortran directory, execute gmake -f Makefile.Solaris clean ; gmake -f Makefile.Solaris test
```

### Windows

For Windows we are using the intel compiler and Visual Studio 2022.


The environment variables IFORT_COMPILER_LIB and JAVA_HOME need to be set.
example:

```cmd
set IFORT_COMPILER_LIB=C:\Program Files (x86)\Intel\oneAPI\compiler\2024.2\lib
set JAVA_HOME=c:\bin\jdk1.8.0
git clone https://github.com/HydrologicEngineeringCenter/hec-dss.git
cd hec-dss
git clone https://github.com/HydrologicEngineeringCenter/dss-test-data.git
build_release.bat
cd test
test_c.bat
cd ..
test_Dss-C.bat
test_fortran.bat
```

## running the java tests
Expand Down
1 change: 0 additions & 1 deletion dss-test-data
Submodule dss-test-data deleted from 87c616
4 changes: 2 additions & 2 deletions heclib/hecdss/hecdss.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalLibraryDirectories>..\heclib_f\$(PlatformName)\$(ConfigurationName);..\..\lib\$(PlatformName);$(IFORT_COMPILER22)compiler\lib\intel64_win;..\heclib_c\$(PlatformName)\$(ConfigurationName);C:\project\hec-dss\heclib\heclib_c\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\heclib_f\$(PlatformName)\$(ConfigurationName);..\..\lib\$(PlatformName);$(IFORT_COMPILER_LIB);..\heclib_c\$(PlatformName)\$(ConfigurationName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>heclib_f.lib;heclib_c.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(ProjectDir)$(Platform)\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
<IgnoreSpecificDefaultLibraries>LIBCMTD;MSVCRT</IgnoreSpecificDefaultLibraries>
Expand Down Expand Up @@ -164,7 +164,7 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalLibraryDirectories>..\heclib_f\$(PlatformName)\$(ConfigurationName);..\..\lib\$(PlatformName);$(IFORT_COMPILER22)compiler\lib\intel64_win;..\heclib_c\$(PlatformName)\$(ConfigurationName);C:\project\hec-dss\heclib\heclib_c\x64\$(ConfigurationName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\heclib_f\$(PlatformName)\$(ConfigurationName);..\..\lib\$(PlatformName);$(IFORT_COMPILER_LIB);..\heclib_c\$(PlatformName)\$(ConfigurationName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>heclib_f.lib;heclib_c.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(ProjectDir)$(Platform)\$(Configuration)\$(TargetName)$(TargetExt)</OutputFile>
</Link>
Expand Down
9 changes: 4 additions & 5 deletions heclib/javaHeclib/javaHeclib.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>C:\Programs\java\jdk1.8.0\include;C:\Programs\java\jdk1.8.0\include\win32;..\heclib_c\src\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;..\heclib_c\src\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;JAVAHECLIB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
Expand All @@ -79,7 +79,7 @@
<Link>
<AdditionalDependencies>heclib_f.lib;heclib_c.lib;zlibstatic.lib</AdditionalDependencies>
<OutputFile>$(ProjectDir)$(Platform)\$(Configuration)\javaHeclib.dll</OutputFile>
<AdditionalLibraryDirectories>..\heclib_c\$(PlatformName)\$(ConfigurationName);..\heclib_f\$(PlatformName)\$(ConfigurationName);..\..\lib\$(PlatformName);$(IFORT_COMPILER22)compiler\lib\intel64_win</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\heclib_c\$(PlatformName)\$(ConfigurationName);..\heclib_f\$(PlatformName)\$(ConfigurationName);..\..\lib\$(PlatformName);$(IFORT_COMPILER_LIB)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>MSVCRT</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
Expand All @@ -104,7 +104,7 @@
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>C:\Programs\java\jdk1.8.0\include;C:\Programs\java\jdk1.8.0\include\win32;..\heclib_c\src\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32;..\heclib_c\src\headers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
Expand All @@ -123,7 +123,7 @@
<Link>
<AdditionalDependencies>heclib_f.lib;heclib_c.lib;zlibstatic.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(ProjectDir)$(Platform)\$(Configuration)\javaHeclib.dll</OutputFile>
<AdditionalLibraryDirectories>..\heclib_c\$(PlatformName)\$(ConfigurationName);..\heclib_f\$(PlatformName)\$(ConfigurationName);..\..\lib\$(PlatformName);$(IFORT_COMPILER22)compiler\lib\intel64_win</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\heclib_c\$(PlatformName)\$(ConfigurationName);..\heclib_f\$(PlatformName)\$(ConfigurationName);..\..\lib\$(PlatformName);$(IFORT_COMPILER_LIB)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>
Expand All @@ -148,7 +148,6 @@
<AdditionalIncludeDirectories>..\heclib_c\src\headers</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>

<ItemGroup>
<ClInclude Include="resource.h" />
<ClInclude Include="src\javaHeclib.h" />
Expand Down
Binary file removed lib/win32/zlibstatic.lib
Binary file not shown.
4 changes: 2 additions & 2 deletions test/Dss-C/Dss-C.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\heclib\heclib_c\$(PlatformName)\$(ConfigurationName);..\..\heclib\heclib_f\$(PlatformName)\$(ConfigurationName);..\..\lib\$(Platform);$(IFORT_COMPILER22)compiler\lib\intel64_win</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\heclib\heclib_c\$(PlatformName)\$(ConfigurationName);..\..\heclib\heclib_f\$(PlatformName)\$(ConfigurationName);..\..\lib\$(Platform);$(IFORT_COMPILER_LIB)</AdditionalLibraryDirectories>
<AdditionalDependencies>heclib_f.lib;heclib_c.lib;zlibstatic.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>LIBCMTD;MSVCRT</IgnoreSpecificDefaultLibraries>
<Profile>true</Profile>
Expand Down Expand Up @@ -125,7 +125,7 @@
<AdditionalIncludeDirectories>..\..\heclib\heclib_c\src\headers;source;.</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\heclib\heclib_c\$(PlatformName)\$(ConfigurationName);..\..\heclib\heclib_f\$(PlatformName)\$(ConfigurationName);..\..\lib\$(Platform);$(IFORT_COMPILER22)compiler\lib\intel64_win</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>..\..\heclib\heclib_c\$(PlatformName)\$(ConfigurationName);..\..\heclib\heclib_f\$(PlatformName)\$(ConfigurationName);..\..\lib\$(Platform);$(IFORT_COMPILER_LIB)</AdditionalLibraryDirectories>
<AdditionalDependencies>heclib_f.lib;heclib_c.lib;zlibstatic.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>LIBCMT</IgnoreSpecificDefaultLibraries>
</Link>
Expand Down

0 comments on commit 1bf6852

Please sign in to comment.