-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from MilanSkocic/dev
0.2.0
- Loading branch information
Showing
227 changed files
with
22,523 additions
and
2,752 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,37 @@ | ||
Create build directory | ||
|
||
.. code-block:: bash | ||
$ mkdir build | ||
$ d build | ||
Generate a makefile | ||
|
||
* On Unix-like OS: | ||
|
||
.. code-block:: bash | ||
cmake -G "Unix Makefiles" -S .. -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=/path/to/folder | ||
* On windows with MSYS2: | ||
|
||
.. code-block:: bash | ||
cmake -G "Unix Makefiles" -S .. -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=/path/to/folder | ||
* On windows with ifort and msvc: | ||
|
||
.. code-block:: bash | ||
cmake -G "NMake Makefiles" -S .. -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=/path/to/folder | ||
Build | ||
|
||
.. code-block:: bash | ||
cmake --build . | ||
Run tests | ||
|
||
.. code-block:: bash | ||
ctest | ||
Install | ||
|
||
.. code-block:: bash | ||
cmake --install . | ||
A Makefile is provided, which uses `fpm <https://fpm.fortran-lang.org/en/index.html>`_, for building the library. | ||
|
||
On windows, `msys2 <https://www.msys2.org>`_ needs to be installed. | ||
|
||
On Darwin, the `gcc <https://formulae.brew.sh/formula/gcc>`_ toolchain needs to be installed. | ||
|
||
Build: the configuration file will set all the environmental variables necessary for the compilation | ||
|
||
.. code-block:: bash | ||
source configuration | ||
make | ||
Run tests | ||
|
||
.. code-block:: bash | ||
fpm test | ||
Install | ||
|
||
.. code-block:: bash | ||
make install | ||
Uninstall | ||
|
||
.. code-block:: bash | ||
make uninstall | ||
If building the python wrapper is needed: | ||
|
||
.. code-block:: bash | ||
cd pywrapper | ||
python setup.py bdist_wheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
ifneq ($(prefix), ) | ||
install_dir=$(prefix) | ||
else | ||
install_dir=$(DEFAULT_INSTALL_DIR) | ||
endif | ||
|
||
.PHONY: all clean install uninstall copy_h copy_a shared_linux shared_windows shared_darwin | ||
|
||
all: $(LIBNAME) | ||
|
||
$(LIBNAME): build copy_h copy_a shared copy_shared | ||
|
||
build: clean | ||
fpm build --profile=release | ||
|
||
shared: shared_$(PLATFORM) | ||
|
||
shared_linux: | ||
gfortran -shared -o $(BUILD_DIR)/lib$(LIBNAME).so -Wl,--whole-archive $(BUILD_DIR)/lib$(LIBNAME).a -Wl,--no-whole-archive | ||
|
||
shared_darwin: | ||
gfortran -dynamiclib -install_name @rpath/lib$(LIBNAME).dylib -static-libgfortran -static-libquadmath -static-libgcc -o $(BUILD_DIR)/lib$(LIBNAME).dylib -Wl,-all_load $(BUILD_DIR)/lib$(LIBNAME).a -Wl,-noall_load | ||
|
||
shared_windows: | ||
gfortran -shared -static -o $(BUILD_DIR)/lib$(LIBNAME).dll -Wl,--out-implib=$(BUILD_DIR)/lib$(LIBNAME).dll.a,--export-all-symbols,--enable-auto-import,--whole-archive $(BUILD_DIR)/lib$(LIBNAME).a -Wl,--no-whole-archive | ||
|
||
copy_a: | ||
cp $(shell find ./build -type f -name lib$(LIBNAME).a) $(BUILD_DIR) | ||
|
||
copy_h: | ||
cp $(INCLUDE_DIR)/$(LIBNAME)*.h $(PYW_MOD_DIR)/ | ||
|
||
copy_shared: copy_a | ||
cp -f $(BUILD_DIR)/lib$(LIBNAME).so $(PYW_MOD_DIR) | true | ||
cp -f $(BUILD_DIR)/lib$(LIBNAME).dylib $(PYW_MOD_DIR) | true | ||
cp -f $(BUILD_DIR)/lib$(LIBNAME).dll $(PYW_MOD_DIR) | true | ||
cp -f $(BUILD_DIR)/lib$(LIBNAME).dll.a $(PYW_MOD_DIR) | true | ||
|
||
clean: | ||
fpm clean --all | ||
|
||
install: | ||
mkdir -p $(install_dir)/bin | ||
mkdir -p $(install_dir)/include | ||
mkdir -p $(install_dir)/lib | ||
fpm install --prefix=$(install_dir) | ||
cp -f ./include/*.h $(install_dir)/include | ||
cp -f $(BUILD_DIR)/lib$(LIBNAME).so $(install_dir)/lib | true | ||
cp -f $(BUILD_DIR)/lib$(LIBNAME).dylib $(install_dir)/lib | true | ||
cp -f $(BUILD_DIR)/lib$(LIBNAME).dll.a $(install_dir)/lib | true | ||
cp -f $(BUILD_DIR)/lib$(LIBNAME).dll $(install_dir)/bin | true | ||
|
||
uninstall: | ||
rm -f $(install_dir)/include/$(LIBNAME)*.h | ||
rm -f $(install_dir)/include/$(LIBNAME)*.mod | ||
rm -f $(install_dir)/lib/lib$(LIBNAME).a | ||
rm -f $(install_dir)/lib/lib$(LIBNAME).so | ||
rm -f $(install_dir)/lib/lib$(LIBNAME).dylib | ||
rm -f $(install_dir)/lib/lib$(LIBNAME).dll.a | ||
rm -f $(install_dir)/bin/lib$(LIBNAME).dll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
gcc>=4.6 or msvc>=14 | ||
|
||
gfortran>=4.6 or ifort>=18 | ||
|
||
cmake>=3.10 | ||
gcc>=10.0 | ||
gfortran>=10.0 | ||
fpm>=0.7 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
LIBNAME="iapws" | ||
|
||
# environment variables | ||
PYW_DIR="./pywrapper" | ||
BUILD_DIR="./build" | ||
INCLUDE_DIR="./include" | ||
PYW_MOD_DIR="$PYW_DIR/py$LIBNAME" | ||
FPM_FFLAGS="-std=f2008 -pedantic -Wall -Wextra" | ||
FPM_CFLAGS="-std=c11 -pedantic -Wall -Wextra" | ||
FPM_LDFLAGS="-static" | ||
DEFAULT_INSTALL_DIR="$HOME/.local" | ||
PLATFORM="linux" | ||
|
||
if [[ "$OSTYPE" == "msys" ]]; then | ||
DEFAULT_INSTALL_DIR="${APPDATA//\\//}/local" | ||
PLATFORM="windows" | ||
fi | ||
|
||
if [[ "$OSTYPE" == "darwin"* ]];then | ||
FPM_LDFLAGS="-static-libgfortran -static-libquadmath -static-libgcc" | ||
PLATFORM="darwin" | ||
fi | ||
|
||
export FPM_FFLAGS | ||
export FPM_CFLAGS | ||
export FPM_LDFLAGS | ||
export DEFAULT_INSTALL_DIR | ||
export LIBNAME | ||
export PYW_DIR | ||
export PYW_MOD_DIR | ||
export BUILD_DIR | ||
export INCLUDE_DIR | ||
export PLATFORM | ||
|
||
echo "OS TYPE=" $OSTYPE | ||
echo "PLATFORM=" $PLATFORM | ||
echo "DEFAULT INSTALL DIR=" $DEFAULT_INSTALL_DIR | ||
echo "FPM_FLAGS=" $FPM_FFLAGS | ||
echo "FPM_CFLAGS=" $FPM_CFLAGS | ||
echo "FPM_LDFLAGS=" $FPM_LDFLAGS | ||
echo "PYW DIR=" $PYW_DIR | ||
echo "PYW MOD DIR=" $PYW_MOD_DIR | ||
echo "BUILD DIR" $BUILD_DIR | ||
echo "INCLUDE_DIR" $INCLUDE_DIR |
File renamed without changes.
File renamed without changes.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.