-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First makefile try * patch, fPIC * fopenmp, experimental plats * dlext * Missed a spot * Filter apple, cleanup makefile * Fix LSM building hopefully * Correct flag names, remove filter * Build LSM_3D, fix some more includes * [OpenLSTO] Use GCC everywhere, it's needed for OpenMP * add LibraryProducts * Move all to default position * I think 1.6 is fine Co-authored-by: Mosè Giordano <[email protected]>
- Loading branch information
Showing
5 changed files
with
785 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Note that this script can accept some limited command-line arguments, run | ||
# `julia build_tarballs.jl --help` to see a usage message. | ||
using BinaryBuilder, Pkg | ||
|
||
name = "OpenLSTO" | ||
version = v"1.0" | ||
|
||
# Collection of sources required to complete build | ||
sources = [ | ||
GitSource("https://github.com/M2DOLab/OpenLSTO.git", "853b9cc433b84c60cd1318a36f9a1d0e6cf65877"), | ||
DirectorySource("./bundled") | ||
] | ||
|
||
# Bash recipe for building across all platforms | ||
# New makefiles added, the patches fix some weird include issues mostly. | ||
# There is likely a better way to fix them, or upstream the fixes. | ||
script = raw""" | ||
cp makefile_FEA $WORKSPACE/srcdir/OpenLSTO/M2DO_FEA/makefile | ||
cp makefile_LSM $WORKSPACE/srcdir/OpenLSTO/M2DO_LSM/makefile | ||
cp makefile_3D_LSM $WORKSPACE/srcdir/OpenLSTO/M2DO_3D_LSM/makefile | ||
# At the moment we need GCC to build with OpenMP | ||
export CXX=g++ | ||
cd $WORKSPACE/srcdir/OpenLSTO | ||
atomic_patch -p1 ../patches/include_and_eigenpath.patch | ||
cd $WORKSPACE/srcdir/OpenLSTO/M2DO_FEA | ||
make -j${nproc} | ||
make install | ||
cd ../M2DO_LSM | ||
mkdir bin | ||
make -j${nproc} | ||
make install | ||
cd ../M2DO_3D_LSM | ||
make -j${nproc} | ||
make install | ||
install_license ${WORKSPACE}/srcdir/OpenLSTO/LICENSE | ||
""" | ||
|
||
# These are the platforms we will build for by default, unless further | ||
# platforms are passed in on the command line | ||
platforms = expand_cxxstring_abis(supported_platforms(; experimental=true); skip=p->false) | ||
|
||
# The products that we will ensure are always built | ||
products = [ | ||
LibraryProduct("m2do_fea", :m2do_fea), | ||
LibraryProduct("m2do_lsm", :m2do_lsm), | ||
LibraryProduct("m2do_3d_lsm", :m2do_3d_lsm) | ||
] | ||
|
||
# Dependencies that must be installed before this package can be built | ||
dependencies = [ | ||
BuildDependency("Eigen_jll"), | ||
Dependency("CompilerSupportLibraries_jll") | ||
] | ||
|
||
# Build the tarballs, and possibly a `build.jl` as well. | ||
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"6", julia_compat="1.6") |
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,39 @@ | ||
# -*- makefile -*- | ||
|
||
CXXFLAGS = -std=c++14 -Wall -fopenmp -w -O3 -fPIC | ||
LDFLAGS = -shared -fopenmp | ||
|
||
LSM_DIR = . | ||
|
||
# CHANGE TO the directory where you want your .o files stored | ||
OBJ_DIR := $(LSM_DIR) | ||
|
||
# Include directories | ||
INCLUDES := -I$(includedir) -I$(includedir)/eigen3 -I$(LSM_DIR) | ||
|
||
SRC_FILES := $(wildcard $(LSM_DIR)/*.cpp) | ||
|
||
OBJ_FILES := $(patsubst $(LSM_DIR)/%.cpp, $(OBJ_DIR)/%.o, $(SRC_FILES)) | ||
|
||
# Make commands for each individual object file | ||
############################################################################### | ||
# Add your own makes here | ||
############################################################################### | ||
# List of targets for executables you write | ||
|
||
m2do_3d_lsm.$(dlext): $(OBJ_FILES) | ||
$(CXX) $(LDFLAGS) $(INCLUDES) -o $@ $(OBJ_FILES) | ||
|
||
$(OBJ_DIR)/%.o: $(LSM_DIR)/%.cpp | ||
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $< | ||
|
||
.PHONY: clean install all | ||
|
||
install: m2do_3d_lsm.$(dlext) | ||
install -d $(libdir) | ||
install -m 644 m2do_3d_lsm.$(dlext) $(libdir) | ||
install -m 644 *.h $(includedir) | ||
clean: | ||
rm -f m2do_3d_lsm.$(dlext) $(OBJ_FILES) | ||
|
||
all: m2do_3d_lsm.$(dlext) |
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,49 @@ | ||
# -*- makefile -*- | ||
|
||
CXXFLAGS = -std=c++14 -Wall -fopenmp -w -O3 -fPIC -fopenmp | ||
LDFLAGS = -shared -fopenmp | ||
# CHANGE TO directory where FEA and LSM include folders are | ||
# parent directory for FEA files | ||
# parent directory for FEA files | ||
|
||
FEA_DIR = . | ||
#LSM_DIR = ./M2DO_LSM/ | ||
|
||
# CHANGE TO the directory where you want your .o files stored | ||
OBJ_DIR := $(FEA_DIR)/bin | ||
|
||
# Include directories | ||
FEA_INCL = $(FEA_DIR)/include | ||
#LSM_INCL = $(LSM_DIR)/include | ||
INCLUDES = -I$(FEA_INCL) -I$(includedir)/eigen3 #-I$(LSM_INCL) | ||
|
||
SRC_DIR := $(FEA_DIR)/src | ||
# List of .o files | ||
# Comment out uncessary object files (if needed) | ||
SRC_FILES := $(filter-out $(SRC_DIR)/utility_functions.cpp, $(wildcard $(SRC_DIR)/*.cpp)) | ||
|
||
OBJ_FILES := $(patsubst $(SRC_DIR)/%.cpp, $(OBJ_DIR)/%.o, $(SRC_FILES)) | ||
# Compile all the M2DO FEA object files | ||
|
||
# Make commands for each individual object file | ||
############################################################################### | ||
# Add your own makes here | ||
############################################################################### | ||
# List of targets for executables you write | ||
|
||
all: m2do_fea.$(dlext) | ||
|
||
m2do_fea.$(dlext): $(OBJ_FILES) | ||
$(CXX) $(LDFLAGS) $(INCLUDES) -o $@ $(OBJ_FILES) | ||
|
||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp | ||
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $< | ||
|
||
install: m2do_fea.$(dlext) | ||
install -d $(libdir) | ||
install -m 644 m2do_fea.$(dlext) $(libdir) | ||
install -m 644 include/*.h $(includedir) | ||
clean: | ||
rm -f m2do_fea.$(dlext) $(OBJ_FILES) | ||
|
||
.PHONY: clean install all |
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,41 @@ | ||
# -*- makefile -*- | ||
|
||
CXXFLAGS = -std=c++14 -Wall -fopenmp -w -O3 -fPIC -fopenmp | ||
LDFLAGS = -shared -fopenmp | ||
|
||
LSM_DIR = . | ||
|
||
# CHANGE TO the directory where you want your .o files stored | ||
OBJ_DIR := $(LSM_DIR)/bin | ||
|
||
# Include directories | ||
LSM_INCL = $(LSM_DIR)/include | ||
INCLUDES = -I$(includedir)/eigen3 -I$(LSM_INCL) | ||
|
||
SRC_DIR := $(LSM_DIR)/src | ||
SRC_FILES := $(wildcard $(SRC_DIR)/*.cpp) | ||
|
||
OBJ_FILES := $(patsubst $(SRC_DIR)/%.cpp, $(OBJ_DIR)/%.o, $(SRC_FILES)) | ||
|
||
# Make commands for each individual object file | ||
############################################################################### | ||
# Add your own makes here | ||
############################################################################### | ||
# List of targets for executables you write | ||
|
||
all: m2do_lsm.$(dlext) | ||
|
||
m2do_lsm.$(dlext): $(OBJ_FILES) | ||
$(CXX) $(LDFLAGS) $(INCLUDES) -o $@ $(OBJ_FILES) | ||
|
||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp | ||
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $< | ||
|
||
install: m2do_lsm.$(dlext) | ||
install -d $(libdir) | ||
install -m 644 m2do_lsm.$(dlext) $(libdir) | ||
install -m 644 include/*.h $(includedir) | ||
clean: | ||
rm -f m2do_lsm.$(dlext) $(OBJ_FILES) | ||
|
||
all: m2do_lsm.$(dlext) |
Oops, something went wrong.