Add boilerplate.

This commit is contained in:
Ciro Santillli 2014-03-31 12:43:46 +02:00
parent 77939adcc1
commit 94181e54ee
28 changed files with 59 additions and 58 deletions

View File

@ -2,4 +2,3 @@ CFLAGS_EXTRA := -Wno-overflow -Wno-sequence-point -Wno-unused-variable -Wno-unus
CXXFLAGS_EXTRA := -Wno-sequence-point -Wno-unused-variable -Wno-unused-but-set-variable -pthread
FFLAGS_EXTRA := -Wno-unused-variable -Wno-unused-but-set-variable
RUN := c
PHONY := install-ubuntu

View File

@ -1,8 +1,7 @@
install-ubuntu:
sudo apt-get update
sudo apt-get install aptitude
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
deps:
sudo aptitude update
sudo aptitude install build-essential
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
# C
sudo aptitude install -y gcc-4.8
sudo aptitude install -y gcc-4.8-doc
@ -12,3 +11,5 @@ install-ubuntu:
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
# Fortran
sudo aptitude install -y gfortran
sudo aptitude install -y g++

View File

@ -14,10 +14,10 @@ Based on Linux tools, but portable code is clearly separated from non-portable.
To compile and run each directory on Ubuntu 12.04 do:
make install-ubuntu
make deps
make run
You *must* run `make install-ubuntu` on the top-level before compiling any subdirectories, as this will install basic tools such as recent enough `gcc` and `g++` for C11 and C++11.
You *must* run `make deps` on the top-level before compiling any subdirectories, as this will install basic tools such as recent enough `gcc` and `g++` for C11 and C++11.
When there are multiple files compiled, e.g.:

1
Vagrantfile vendored Symbolic link
View File

@ -0,0 +1 @@
boilerplate/Vagrantfile

View File

@ -0,0 +1,7 @@
# This file is gitignored.
Box = "precise32"
BoxUrl = "http://files.vagrantup.com/precise32.box"
#Box = "debian-7.2.0"
#BoxUrl = "https://dl.dropboxusercontent.com/u/197673519/debian-7.2.0.box"

@ -1 +1 @@
Subproject commit b85292b5f3ff5550825a00d13c6466860636afe8
Subproject commit 9b38035ce9b64f9d7aca1359e956c1b8a85a94aa

View File

@ -1,2 +1 @@
LIBS := -lboost_graph -lm
PHONY := install-ubuntu

View File

@ -1,3 +1,3 @@
install-ubuntu:
deps:
sudo aptitude update
sudo aptitude install -y libboost1.48-all-dev

View File

@ -1,2 +1 @@
LIBS := -lgsl -lgslcblas -lm -lplplotd
PHONY := install-ubuntu

View File

@ -1,4 +1,4 @@
install-ubuntu:
deps:
sudo aptitude update
# gsl
sudo aptitude install -y libgsl0-dev gsl-doc-info

View File

@ -2,4 +2,3 @@ PKGNAME := gtk+-3.0
CFLAGS := $(shell pkg-config --cflags "$(PKGNAME)")
LIBS := $(shell pkg-config --libs "$(PKGNAME)")
RUN := min
PHONY := install-ubuntu

View File

@ -1,3 +1,3 @@
install-ubuntu:
deps:
sudo aptitude update
sudo aptitude install -y libgtk-3-dev

View File

@ -13,7 +13,7 @@ clean:
install: all
cd "$(BUILD_DIR)" && make install
install-ubuntu:
deps:
sudo aptitude install -y kdelibs5-dev
run: all

View File

@ -1,3 +1,2 @@
LIBS := -lm -lblas -llapacke
FFLIBS := -l:libblas/libblas.so -l:lapack/liblapack.so
PHONY := install-ubuntu

View File

@ -1,4 +1,4 @@
install-ubuntu:
deps:
sudo aptitude update
# BLAS C/Fotran and LAPACK Fortran:
sudo aptitude install -y liblapack-dev

View File

@ -1,2 +1 @@
LIBS := -lode
PHONY := install-ubuntu

View File

@ -1,3 +1,3 @@
install-ubuntu:
deps:
sudo aptitude update
sudo aptitude install -y libode-dev

View File

@ -35,5 +35,5 @@ $(OUT_DIR)%$(OUT_EXT): $(IN_DIR)%$(IN_EXT)
clean:
rm -rf $(OUT_DIR) $(AUX_DIR)
install-ubuntu:
deps:
sudo apt-get install -y libopencv-dev opencv-doc

View File

@ -1,2 +1 @@
LIBS := -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann -lm
PHONY := install-ubuntu

View File

@ -1,3 +1,3 @@
install-ubuntu:
deps:
sudo aptitude update
sudo aptitude install -y libopencv-dev

View File

@ -1,2 +1 @@
LIBS := -lm -pthread -lGL -lGLU -lglut
PHONY := install-ubuntu

View File

@ -1,2 +1,2 @@
install-ubuntu:
deps:
sudo apt-get install -y freeglut3-dev

View File

@ -28,6 +28,6 @@ mkdir:
clean:
rm -rf $(OUT_DIR) $(SAUX_DIR)
install-ubuntu:
deps:
sudo apt-get install freeglut-dev
sudo apt-get install libopencv-dev

View File

@ -1,2 +1 @@
LIBS := -lm -lplplotd
PHONY := install-ubuntu

View File

@ -1,4 +1,4 @@
install-ubuntu:
deps:
sudo aptitude update
sudo aptitude install -y libplplot-dev
sudo aptitude install -y plplot11-driver-xwin

View File

@ -21,7 +21,7 @@ install: all
install-run:
$(TARGET)
install-ubuntu:
deps:
sudo aptitude update
sudo aptitude install -y libqt4-dev

30
test
View File

@ -1,30 +0,0 @@
#!/usr/bin/env python
"""
Run executables with filenames given in argv[2:] and inside directory argv[1].
Stop on the first that returns non 0 status.
"""
import os
import subprocess
import sys
out_dir = sys.argv[1]
out_files = sys.argv[2:]
os.chdir(out_dir)
# TODO make tac work.
for out_file in [ x for x in out_files if not x in ['tac']]:
process = subprocess.Popen(
['./' + out_file],
shell = False,
stdin = subprocess.PIPE,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE,
universal_newlines = True
)
exit_status = process.wait()
if exit_status != 0:
print "Test failed for file: " + out_file
sys.exit(1)
print "All tests passed."

1
test Symbolic link
View File

@ -0,0 +1 @@
test_many

30
test_many Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env python
"""
Run executables with filenames given in argv[2:] and inside directory argv[1].
Stop on the first that returns non 0 status.
"""
import os
import subprocess
import sys
out_dir = sys.argv[1]
out_files = sys.argv[2:]
os.chdir(out_dir)
# TODO make tac work.
for out_file in [ x for x in out_files if not x in ['tac']]:
process = subprocess.Popen(
['./' + out_file],
shell = False,
stdin = subprocess.PIPE,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE,
universal_newlines = True
)
exit_status = process.wait()
if exit_status != 0:
print "Test failed for file: " + out_file
sys.exit(1)
print "All tests passed."