Skip to content

Commit

Permalink
Merge e865f11 into 6f45c86
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesYang007 committed Apr 28, 2020
2 parents 6f45c86 + e865f11 commit d217d92
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ build
.vscode
.*
!.travis.yml
lib/armadillo
lib/FastAD
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "lib/benchmark"]
path = lib/benchmark
url = https://github.com/google/benchmark.git
[submodule "lib/FastAD"]
path = lib/FastAD
url = https://github.com/JamesYang007/FastAD.git
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'cmake', 'ninja-build', 'valgrind',
'libopenblas-dev', 'liblapack-dev',
'libarpack2-dev']
'libarpack2-dev', 'realpath']
env:
- CXX_COMPILER="g++-7"
- CC_COMPILER="gcc-7"
Expand All @@ -34,7 +34,7 @@ jobs:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'cmake', 'ninja-build',
'libopenblas-dev', 'liblapack-dev',
'libarpack2-dev']
'libarpack2-dev', 'realpath']
before_install:
- sudo -H pip install --upgrade requests[security]
- pip install --user cpp-coveralls
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'ninja-build',
'libopenblas-dev', 'liblapack-dev',
'libarpack2-dev']
'libarpack2-dev', 'realpath']

- os: linux
compiler: gcc
Expand All @@ -77,7 +77,7 @@ jobs:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-8', 'ninja-build',
'libopenblas-dev', 'liblapack-dev',
'libarpack2-dev']
'libarpack2-dev', 'realpath']

- os: linux
compiler: gcc
Expand All @@ -89,7 +89,7 @@ jobs:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-9', 'ninja-build',
'libopenblas-dev', 'liblapack-dev',
'libarpack2-dev']
'libarpack2-dev', 'realpath']

# Build Script

Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ target_include_directories(${PROJECT_NAME}
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)

# Find Armadillo C++
find_package(Armadillo REQUIRED)
find_package(Armadillo CONFIG REQUIRED
HINTS ${CMAKE_CURRENT_SOURCE_DIR}/lib/armadillo)
message(STATUS "Found Armadillo config at: ${Armadillo_DIR}")

# Find FastAD
find_package(FastAD CONFIG REQUIRED)
find_package(FastAD CONFIG REQUIRED
HINTS ${CMAKE_CURRENT_SOURCE_DIR}/lib/FastAD)
message(STATUS "Found FastAD config at: ${FastAD_DIR}")

# Configure tests
if (AUTOPPL_ENABLE_TEST)
Expand Down
1 change: 0 additions & 1 deletion lib/FastAD
Submodule FastAD deleted from 716d6a
33 changes: 23 additions & 10 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

projectdir=$(dirname "BASH_SOURCE")
projectdir=$(realpath "$(dirname "${BASH_SOURCE[0]}")")

gbenchpath="lib/benchmark"
gtestpath="$gbenchpath/googletest"

Expand All @@ -15,23 +16,35 @@ if [ ! -d "$gtestpath" ]; then
cd ~- # change back to previous dir and no output to terminal
fi

# install Armadillo only on Linux
if [[ "$OSTYPE" == "linux-gnu" ]]; then
sudo apt install libopenblas-dev liblapack-dev
# setup Armadillo
if [[ "$OSTYPE" == "linux-gnu" || "$OSTYPE" == "darwin"* ]]; then
cd /tmp
if [[ "$OSTYPE" == "linux-gnu" ]]; then
sudo apt install libopenblas-dev liblapack-dev
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew install openblas lapack
fi
wget http://sourceforge.net/projects/arma/files/armadillo-9.870.2.tar.xz
if [ -d "armadillo-9.870.2" ]; then
rm -rf armadillo-9.870.2
fi
tar -xvf armadillo-9.870.2.tar.xz
cd armadillo-9.870.2
cmake .
cmake . -DCMAKE_INSTALL_PREFIX="$projectdir/lib/armadillo"
make
sudo make install
make install
cd $projectdir
fi

# install FastAD
# setup FastAD
cd /tmp
git clone --recurse-submodules https://github.com/JamesYang007/FastAD.git FastAD
cd FastAD
if [ ! -d "FastAD" ]; then
git clone https://github.com/JamesYang007/FastAD.git
fi
cd FastAD && git pull
./setup.sh
./install.sh
./clean-build.sh release -DFASTAD_ENABLE_TEST=OFF \
-DCMAKE_INSTALL_PREFIX="$projectdir/lib/FastAD"
cd build/release
ninja install
cd $projectdir

0 comments on commit d217d92

Please sign in to comment.