compile fixes

This commit is contained in:
Sebastian Held 2012-03-02 20:26:36 +01:00
parent 07890c4da8
commit 1509e80454
4 changed files with 46 additions and 37 deletions

View File

@ -8,7 +8,7 @@
# This is the debhelper compatibility version to use. # This is the debhelper compatibility version to use.
export DH_COMPAT=4 export DH_COMPAT=4
CFLAGS = -g CFLAGS = -g -msse
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0 CFLAGS += -O0
else else
@ -20,12 +20,10 @@ build-stamp:
dh_testdir dh_testdir
# Add here commands to compile the package. # Add here commands to compile the package.
qmake-qt4 QMAKE_CFLAGS="$$CFLAGS" QMAKE_CXXFLAGS="$$CFLAGS" openEMS.pro qmake-qt4 QMAKE_CFLAGS="$$CFLAGS" QMAKE_CXXFLAGS="$$CFLAGS" CONFIG+=packaging openEMS.pro
make make
cd nf2ff cd nf2ff && qmake-qt4 QMAKE_CFLAGS="$$CFLAGS" QMAKE_CXXFLAGS="$$CFLAGS" CONFIG+=packaging nf2ff.pro
qmake-qt4 QMAKE_CFLAGS="$$CFLAGS" QMAKE_CXXFLAGS="$$CFLAGS" nf2ff.pro make -C nf2ff
make
cd ..
# --- end custom part for compiling # --- end custom part for compiling
touch build-stamp touch build-stamp
@ -37,6 +35,7 @@ clean:
# Add here commands to clean up after the build process. # Add here commands to clean up after the build process.
make clean || true make clean || true
make -C nf2ff clean || true
# --- end custom part for cleaning up # --- end custom part for cleaning up
dh_clean dh_clean
@ -50,9 +49,7 @@ install: build
# Add here commands to install the package # Add here commands to install the package
# The DESTDIR Has To Be Exactly /usr/src/packages/BUILD/debian/<nameOfPackage> # The DESTDIR Has To Be Exactly /usr/src/packages/BUILD/debian/<nameOfPackage>
make install INSTALL_ROOT=/usr/src/packages/BUILD/debian/openems make install INSTALL_ROOT=/usr/src/packages/BUILD/debian/openems
cd nf2ff make -C nf2ff install INSTALL_ROOT=/usr/src/packages/BUILD/debian/openems
make install INSTALL_ROOT=/usr/src/packages/BUILD/debian/openems
cd ..
# --- end custom part for installing # --- end custom part for installing
# Build architecture-independent files here. # Build architecture-independent files here.

View File

@ -57,10 +57,10 @@ OpenEMS is a free and open-source electromagnetic field solver using the (EC-)FD
%build %build
ADDFLAGS="-msse" # enable at least the SSE command set (no SSE makes no sense -- way too slow) ADDFLAGS="-msse" # enable at least the SSE command set (no SSE makes no sense -- way too slow)
%qmake QMAKE_CFLAGS="%optflags $ADDFLAGS" QMAKE_CXXFLAGS="%optflags $ADDFLAGS" LIB_SUFFIX="$(echo %_lib | cut -b4-)" openEMS.pro %qmake QMAKE_CFLAGS="%optflags $ADDFLAGS" QMAKE_CXXFLAGS="%optflags $ADDFLAGS" LIB_SUFFIX="$(echo %_lib | cut -b4-)" CONFIG+=packaging openEMS.pro
make %{?_smp_mflags} make %{?_smp_mflags}
cd nf2ff cd nf2ff
%qmake QMAKE_CFLAGS="%optflags $ADDFLAGS" QMAKE_CXXFLAGS="%optflags $ADDFLAGS" LIB_SUFFIX="$(echo %_lib | cut -b4-)" nf2ff.pro %qmake QMAKE_CFLAGS="%optflags $ADDFLAGS" QMAKE_CXXFLAGS="%optflags $ADDFLAGS" LIB_SUFFIX="$(echo %_lib | cut -b4-)" CONFIG+=packaging nf2ff.pro
make %{?_smp_mflags} make %{?_smp_mflags}
cd .. cd ..

View File

@ -6,19 +6,21 @@ CONFIG += debug_and_release
win32 { win32 {
CONFIG += console CONFIG += console
QMAKE_CXXFLAGS += -DH5_USE_16_API
INCLUDEPATH += ../../hdf5/include ../../hdf5/include/cpp ../../boost/include/boost-1_42 INCLUDEPATH += ../../hdf5/include ../../hdf5/include/cpp ../../boost/include/boost-1_42
LIBS += ../../hdf5/lib/hdf5.lib LIBS += ../../hdf5/lib/hdf5.lib
LIBS += ../../boost/lib/libboost_thread-mgw44-mt.lib LIBS += ../../boost/lib/libboost_thread-mgw44-mt.lib
LIBS += ../../tinyxml/release/libtinyxml2.a LIBS += ../../tinyxml/release/libtinyxml2.a
} }
!win32 { !win32 {
LIBS += -lboost_thread LIBS += -lboost_thread-mt
LIBS += -lhdf5 LIBS += -lhdf5
LIBS += ../../tinyxml/libtinyxml.so LIBS += -L../tinyxml -ltinyxml
} }
QMAKE_LFLAGS += \'-Wl,-rpath,\$$ORIGIN/../../tinyxml\' QMAKE_LFLAGS += \'-Wl,-rpath,\$$ORIGIN/../../tinyxml\'
# hdf5 compat
DEFINES += H5_USE_16_API
TOOLSPATH = ../tools TOOLSPATH = ../tools
#### SOURCES ################################################################ #### SOURCES ################################################################
@ -46,12 +48,16 @@ HEADERS += $$TOOLSPATH/constants.h \
$$TOOLSPATH/hdf5_file_reader.h \ $$TOOLSPATH/hdf5_file_reader.h \
$$TOOLSPATH/hdf5_file_writer.h $$TOOLSPATH/hdf5_file_writer.h
!packaging {
# if packaging is not set in CONFIG, set some default flags
# if packaging is enabled, give the flags on the qmake comandline
QMAKE_CXXFLAGS_RELEASE = -O3 \ QMAKE_CXXFLAGS_RELEASE = -O3 \
-g \ -g \
-march=native -march=native
QMAKE_CXXFLAGS_DEBUG = -O0 \ QMAKE_CXXFLAGS_DEBUG = -O0 \
-g \ -g \
-march=native -march=native
}
# add git revision # add git revision
# QMAKE_CXXFLAGS += -DGIT_VERSION=\\\"`git describe --tags`\\\" # QMAKE_CXXFLAGS += -DGIT_VERSION=\\\"`git describe --tags`\\\"

View File

@ -2,11 +2,9 @@
# Project created by QtCreator 2010-02-26T22:34:51 # Project created by QtCreator 2010-02-26T22:34:51
# ------------------------------------------------- # -------------------------------------------------
TARGET = openEMS TARGET = openEMS
CONFIG += console
CONFIG -= app_bundle qt CONFIG -= app_bundle qt
TEMPLATE = app TEMPLATE = app
OBJECTS_DIR = obj OBJECTS_DIR = obj
INCLUDEPATH += .
INCLUDEPATH += ../CSXCAD \ INCLUDEPATH += ../CSXCAD \
../fparser \ ../fparser \
../tinyxml ../tinyxml
@ -37,10 +35,10 @@ VERSION=0.0.27
WIN32_LIB_ROOT = .. WIN32_LIB_ROOT = ..
win32 { win32 {
QMAKE_CXXFLAGS += -DH5_USE_16_API CONFIG += console
INCLUDEPATH += $$WIN32_LIB_ROOT/hdf5/include $$WIN32_LIB_ROOT/hdf5/include/cpp $$WIN32_LIB_ROOT/boost/include/boost-1_42 INCLUDEPATH += $$WIN32_LIB_ROOT/hdf5/include $$WIN32_LIB_ROOT/hdf5/include/cpp $$WIN32_LIB_ROOT/boost/include/boost-1_42
LIBS += $$WIN32_LIB_ROOT/hdf5/lib/hdf5.lib LIBS += $$WIN32_LIB_ROOT/hdf5/lib/hdf5.lib
LIBS += $$WIN32_LIB_ROOT/boost/lib/libboost_thread-mgw44-mt.lib LIBS += $$WIN32_LIB_ROOT/boost/lib/libboost_thread-mgw44-mt.lib
LIBS += -L../CSXCAD/release LIBS += -L../CSXCAD/release
LIBS += ../fparser/release/libfparser4.a LIBS += ../fparser/release/libfparser4.a
LIBS += ../tinyxml/release/libtinyxml2.a LIBS += ../tinyxml/release/libtinyxml2.a
@ -59,7 +57,7 @@ win32 {
!win32 { !win32 {
LIBS += -L../fparser -lfparser LIBS += -L../fparser -lfparser
LIBS += -L../tinyxml -ltinyxml LIBS += -L../tinyxml -ltinyxml
LIBS += -lboost_thread LIBS += -lboost_thread-mt
LIBS += -lhdf5 -lhdf5_cpp LIBS += -lhdf5 -lhdf5_cpp
### vtk ### ### vtk ###
INCLUDEPATH += /usr/include/vtk-5.2 \ INCLUDEPATH += /usr/include/vtk-5.2 \
@ -77,6 +75,10 @@ QMAKE_LFLAGS += \'-Wl,-rpath,\$$ORIGIN/../CSXCAD\'
QMAKE_LFLAGS += \'-Wl,-rpath,\$$ORIGIN/../fparser\' QMAKE_LFLAGS += \'-Wl,-rpath,\$$ORIGIN/../fparser\'
QMAKE_LFLAGS += \'-Wl,-rpath,\$$ORIGIN/../tinyxml\' QMAKE_LFLAGS += \'-Wl,-rpath,\$$ORIGIN/../tinyxml\'
# hdf5 compat
DEFINES += H5_USE_16_API
#### SOURCES ################################################################ #### SOURCES ################################################################
SOURCES += main.cpp \ SOURCES += main.cpp \
openems.cpp openems.cpp
@ -128,8 +130,8 @@ SOURCES += Common/operator_base.cpp \
Common/processfields_td.cpp \ Common/processfields_td.cpp \
Common/processcurrent.cpp \ Common/processcurrent.cpp \
Common/processfields_fd.cpp \ Common/processfields_fd.cpp \
Common/processfieldprobe.cpp \ Common/processfieldprobe.cpp \
Common/processfields_sar.cpp Common/processfields_sar.cpp
# tools # tools
SOURCES += tools/global.cpp \ SOURCES += tools/global.cpp \
@ -156,9 +158,9 @@ HEADERS += FDTD/engine.h \
FDTD/operator_multithread.h \ FDTD/operator_multithread.h \
FDTD/operator_cylindermultigrid.h \ FDTD/operator_cylindermultigrid.h \
FDTD/engine_cylindermultigrid.h \ FDTD/engine_cylindermultigrid.h \
FDTD/engine_interface_fdtd.h \ FDTD/engine_interface_fdtd.h \
FDTD/engine_interface_sse_fdtd.h \ FDTD/engine_interface_sse_fdtd.h \
FDTD/engine_interface_cylindrical_fdtd.h FDTD/engine_interface_cylindrical_fdtd.h
# FDTD/extensions header files # FDTD/extensions header files
HEADERS += FDTD/extensions/operator_extension.h \ HEADERS += FDTD/extensions/operator_extension.h \
@ -191,7 +193,7 @@ HEADERS += Common/operator_base.h \
Common/processmodematch.h \ Common/processmodematch.h \
Common/processfields_fd.h \ Common/processfields_fd.h \
Common/processfieldprobe.h \ Common/processfieldprobe.h \
Common/processfields_sar.h Common/processfields_sar.h
# tools # tools
HEADERS += tools/ErrorMsg.h \ HEADERS += tools/ErrorMsg.h \
@ -204,27 +206,31 @@ HEADERS += tools/ErrorMsg.h \
tools/vtk_file_writer.h \ tools/vtk_file_writer.h \
tools/hdf5_file_writer.h tools/hdf5_file_writer.h
!packaging {
# if packaging is not set in CONFIG, set some default flags
# if packaging is enabled, give the flags on the qmake comandline
QMAKE_CXXFLAGS_RELEASE = -O3 \ QMAKE_CXXFLAGS_RELEASE = -O3 \
-g \ -g \
-march=native -march=native
QMAKE_CXXFLAGS_DEBUG = -O0 \ QMAKE_CXXFLAGS_DEBUG = -O0 \
-g \ -g \
-march=native -march=native
}
MPI_SUPPORT { MPI_SUPPORT {
DEFINES += MPI_SUPPORT DEFINES += MPI_SUPPORT
QMAKE_CC = mpicc QMAKE_CC = mpicc
QMAKE_CXX = mpicxx QMAKE_CXX = mpicxx
QMAKE_LINK = mpicxx QMAKE_LINK = mpicxx
QMAKE_LINK_C = mpicc QMAKE_LINK_C = mpicc
HEADERS += FDTD/operator_mpi.h \ HEADERS += FDTD/operator_mpi.h \
FDTD/engine_mpi.h \ FDTD/engine_mpi.h \
FDTD/openems_fdtd_mpi.h FDTD/openems_fdtd_mpi.h
SOURCES += FDTD/operator_mpi.cpp \ SOURCES += FDTD/operator_mpi.cpp \
FDTD/engine_mpi.cpp \ FDTD/engine_mpi.cpp \
FDTD/openems_fdtd_mpi.cpp FDTD/openems_fdtd_mpi.cpp
QMAKE_CXXFLAGS_RELEASE += -Wno-unused-parameter #needed because mpich2 produces tons of unused parameter QMAKE_CXXFLAGS_RELEASE += -Wno-unused-parameter #needed because mpich2 produces tons of unused parameter
} }
# add git revision # add git revision