Skip to content

Commit

Permalink
Allow make to use system zlib (#897)
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Dec 31, 2024
1 parent 0f18100 commit 72aff74
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion COMPILE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cmake -DUSE_OPENJPEG=ON -DCMAKE_CXX_FLAGS=-g .. && make
```

##### ZLIB BUILD
If we have zlib, we can use it (-lz) and disable [miniz](https://code.google.com/p/miniz/) (-myDisableMiniZ)
If we have zlib, we can use it (-lz) and disable [miniz](https://code.google.com/p/miniz/) (-DmyDisableMiniZ)

```
g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp nii_foreign.cpp -o dcm2niix -lz -DmyDisableMiniZ g++ -O3 -I. main_console.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp nii_foreign.cpp -o dcm2niix -DmyDisableOpenJPEG -Wl,-stack_size -Wl,3f00000
Expand Down
6 changes: 5 additions & 1 deletion console/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ LFLAGS=
# https://clang.llvm.org/docs/AddressSanitizer.html
# clang++ -O1 -g -fsanitize=address -fno-omit-frame-pointer -I. main_console.cpp nii_foreign.cpp nii_dicom.cpp jpg_0XC3.cpp ujpeg.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp base64.c cJSON.c -o dcm2niix -DmyDisableOpenJPEG

#run "ZLIB=1 make" for ZLIB build
ifeq "$(ZLIB)" "1"
CFILES += -DmyDisableMiniZ -lz
endif

#run "make" for default build
#run "JPEGLS=1 make" for JPEGLS build
Expand Down Expand Up @@ -59,7 +63,7 @@ debug:
g++ -O0 $(LFLAGS) $(UFILES)

jp2:
g++ -O0 $(LFLAGS) $(CFILES) $(JFLAGS) -I/opt/homebrew/Cellar/openjpeg/2.5.3/include/openjpeg-2.5/ -L/opt/homebrew/Cellar/openjpeg/2.5.3/lib/ -lopenjp2
g++ $(CFLAGS) $(LFLAGS) $(CFILES) $(JFLAGS) -I/opt/homebrew/Cellar/openjpeg/2.5.3/include/openjpeg-2.5/ -L/opt/homebrew/Cellar/openjpeg/2.5.3/lib/ -lopenjp2

noroi:
g++ $(CFLAGS) -I. $(JSFLAGS) $(JFLAGS) $(LFLAGS) $(UFILES) -DmyNoRois
Expand Down
2 changes: 1 addition & 1 deletion console/nii_dicom.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extern "C" {
#define kCPUsuf " " // unknown CPU
#endif

#define kDCMdate "v1.0.20241211"
#define kDCMdate "v1.0.20241231"
#define kDCMvers kDCMdate " " kJP2suf kLSsuf kCCsuf kCPUsuf

static const int kMaxEPI3D = 1024; // maximum number of EPI images in Siemens Mosaic
Expand Down

0 comments on commit 72aff74

Please sign in to comment.