Skip to content

Commit

Permalink
shared objects and cleanup for build script
Browse files Browse the repository at this point in the history
  • Loading branch information
mpatrou committed Feb 18, 2025
1 parent 8a5b046 commit ebc0374
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions conda.recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
#!/usr/bin/env bash

# Create the include directory in the package
echo $PREFIX/include/histogram
ls lib/
#lib folder
mkdir -p $PREFIX/include/histogram
cp -r lib/* $PREFIX/include/histogram/

# Create the lib directory for shared libraries (.so or .dylib files)
# PROJ_SRCS = \
# Array_1D.cc \
# events2Ix.cc \
# events2Ixy.cc \
# Event2Quantity.cc \
# NdArray.cc \
# NdArraySlice.cc \
#mkdir -p $PREFIX/lib
#$(CXX) $(CXXFLAGS) -fPIC $(ls lib/*.cc) -o $PREFIX/lib/libhistogram.so
#cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -DDEPLOYMENT_PREFIX=$PREFIX .. && make -j 2 && make install
#shared library
mkdir build_files/
cp -r lib/* build_files/
cd build_files
src_files=$(ls *.cc)

#mkdir -p $PREFIX/lib
#c++ -O3 -Wall -shared -std=c++11 -fPIC $(ls lib) -o $PREFIX/lib/libhistogram.so

#Install the Python files
#mkdir -p $PREFIX/lib/python${PYSHORT_VERSION}/site-packages/histogram
#cp -r src/* $PREFIX/lib/python${PYSHORT_VERSION}/site-packages/histogram/
mkdir -p $PREFIX/lib
g++ -c -fPIC $src_files
g++ -shared -o $PREFIX/lib/libhistogram.so $(ls *.o)
cd ../

#Python files
mkdir -p $PREFIX/lib/python$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')/site-packages/histogram
cp -r src/histogram/* $PREFIX/lib/python$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')/site-packages/histogram/

#Executable
mkdir -p $PREFIX/bin
cp -r bin/plothist $PREFIX/bin/

0 comments on commit ebc0374

Please sign in to comment.