Skip to content

Commit 65801a2

Browse files
authored
cmake work, includes 2x speedup for windows build (#349)
* speedup windows build simplify heclib * cmake:, make source of heclib private * drop powf_wrap.c (Centos/RHEL 7)
1 parent a075457 commit 65801a2

File tree

9 files changed

+22
-69
lines changed

9 files changed

+22
-69
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ add_subdirectory(heclib)
1111

1212
find_package(Git QUIET)
1313
if(DSS_TEST_DATA_DIR)
14-
option(RUN_TESTS "Run Tests, requires initializing a git submodule." ON)
14+
option(RUN_TESTS "Run Tests, requires dss-test-data git repo." ON)
1515
if(RUN_TESTS)
1616
enable_testing()
1717
add_subdirectory(test)

heclib/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11

22
add_subdirectory(heclib_c)
3-
4-
add_library(heclib STATIC $<TARGET_OBJECTS:heclib_c>)
5-
6-
7-
if(MSVC)
8-
target_link_libraries(heclib PRIVATE zlibstatic)
9-
else()
10-
target_link_libraries(heclib PRIVATE ZLIB::ZLIBSTATIC)
11-
endif()
12-
13-
target_include_directories(heclib PUBLIC ${CMAKE_CURRENT_LIST_DIR}/heclib_c/src/headers)
14-
153
add_subdirectory(hecdss)
164
add_subdirectory(javaHeclib)

heclib/hecdss/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ifeq ($(UNAME_S),Linux)
88
ifeq ($(UNAME_M),aarch64)
99
LDFLAGS1=-Wl,-z,defs
1010
else
11-
LDFLAGS1=-Wl,-z,defs,--wrap=powf
11+
LDFLAGS1=-Wl,-z,defs
1212
BITS=-m64
1313
endif
1414
CFLAGS=$(BITS) -fPIC -g -std=gnu99 $(CWARNING) $(INC_DIRS) -D__linux__

heclib/heclib_c/CMakeLists.txt

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
1-
2-
add_library(heclib_c OBJECT ${C_SRC})
1+
add_library(heclib STATIC)
32

43
if( ${CMAKE_C_COMPILER_ID} MATCHES GNU)
5-
target_compile_options(heclib_c PRIVATE -fPIC -std=gnu99)
4+
target_compile_options(heclib PRIVATE -fPIC -std=gnu99)
65
elseif(${CMAKE_C_COMPILER_ID} MATCHES SunPro)
7-
target_compiler_options(heclib_c PRIVATE -m64 -xmemalign=2i -xcode=pic32 -c -Isrc/headers -mt -xcode=abs64 -xstrconst -xc99=all -xCC -g -xs)
6+
target_compile_options(heclib PRIVATE -m64 -xmemalign=2i -xcode=pic32 -c -Isrc/headers -mt -xcode=abs64 -xstrconst -xc99=all -xCC -g -xs)
7+
elsif(MSVC)
8+
target_compile_options(heclib PRIVATE /Wall /MP)
89
else()
910
message(STATUS "generic options")
1011
endif()
11-
target_include_directories(heclib_c PUBLIC src/headers)
12-
target_link_libraries(heclib_c PRIVATE ZLIB::ZLIBSTATIC)
13-
# Keep all logic above this like, only include source references here (including headers)
14-
target_sources(heclib_c PUBLIC # most of this should really be private but for the sake of initial simplicity don't worry about it.
12+
13+
14+
target_include_directories(heclib PUBLIC src/headers)
15+
16+
if(MSVC)
17+
target_link_libraries(heclib PUBLIC zlibstatic)
18+
else()
19+
target_link_libraries(heclib PUBLIC ZLIB::ZLIBSTATIC)
20+
endif()
21+
22+
target_sources(heclib PRIVATE
1523
src/Internal/ztsIncrementBlock.c
1624
src/Internal/zhash.c
1725
src/Internal/zpdUnitsToHead.c
@@ -53,7 +61,6 @@ src/Internal/ztsIrregStoreBlock.c
5361
src/Internal/ztsRegRepeatCompress.c
5462
src/Internal/zreadInfo.c
5563
src/Internal/zinitIfltab.c
56-
src/Internal/powf_wrap.c
5764
src/Internal/zcatParsePath.c
5865
src/Internal/ztsGetSizesInternal.c
5966
src/Internal/zcheckInternal.c

heclib/heclib_c/heclib_c.vcxproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
<ClCompile Include="src\Internal\charInt.c" />
4141
<ClCompile Include="src\Internal\charLong.c" />
4242
<ClCompile Include="src\Internal\isTsPattern.c" />
43-
<ClCompile Include="src\Internal\powf_wrap.c" />
4443
<ClCompile Include="src\Internal\zbinNew.c" />
4544
<ClCompile Include="src\Internal\zbinUpdate.c" />
4645
<ClCompile Include="src\Internal\zcatalogInternal.c" />

heclib/heclib_c/heclib_c.vcxproj.filters

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,6 @@
345345
<ClCompile Include="src\Internal\charLong.c">
346346
<Filter>src\Internal</Filter>
347347
</ClCompile>
348-
<ClCompile Include="src\Internal\powf_wrap.c">
349-
<Filter>src\Internal</Filter>
350-
</ClCompile>
351348
<ClCompile Include="src\Internal\zbinNew.c">
352349
<Filter>src\Internal</Filter>
353350
</ClCompile>

heclib/heclib_c/src/Internal/powf_wrap.c

Lines changed: 0 additions & 40 deletions
This file was deleted.

heclib/javaHeclib/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ if(JNI_FOUND)
66
if( ${CMAKE_C_COMPILER_ID} MATCHES GNU)
77
target_compile_options(javaHeclib PRIVATE -fPIC -std=gnu99)
88
elseif(${CMAKE_C_COMPILER_ID} MATCHES SunPro)
9-
target_compiler_options(javaHecib PRIVATE -m64 -xmemalign=2i -xcode=pic32 -c -Isrc/headers -mt -xcode=abs64 -xstrconst -xc99=all -xCC -g -xs)
9+
target_compile_options(javaHeclib PRIVATE -m64 -xmemalign=2i -xcode=pic32 -c -Isrc/headers -mt -xcode=abs64 -xstrconst -xc99=all -xCC -g -xs)
10+
elsif(MSVC)
11+
target_compile_options(heclib PRIVATE /Wall /MP)
1012
else()
1113
message(STATUS "generic options")
1214
endif()

heclib/javaHeclib/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ UNAME_S := $(shell uname -s)
44
ifeq ($(UNAME_S),Linux)
55
FDEBUG=-fcheck=all,no-recursion
66
CFLAGS=-fPIC -g -std=gnu99 -Werror $(INC_DIRS) -D__linux__ -fcommon
7-
LDFLAGS=-Wl,-z,defs,--wrap=powf -lz -lrt -lgfortran -lm
7+
LDFLAGS=-Wl,-z,defs -lz -lrt -lgfortran -lm
88
endif
99
ifeq ($(UNAME_S),SunOS)
1010
CC=cc

0 commit comments

Comments
 (0)