|
[Sponsors] |
January 11, 2015, 15:31 |
understanding wmake
|
#1 |
New Member
Join Date: May 2013
Posts: 6
Rep Power: 13 |
Dear all,
I am having difficulties in understanding how wmake works and how I can correctly compile an application to include subdirectories in the application folder. I was experimenting using a rather simple example, which I named test_wmake utility. For this I employed the following file structure: HTML Code:
Folder test_utility test_wmake.C -Folder Make -files -options -Folder Classes classA.H classA.C -Folder classB classB.H classB.C test_wmake.C: Code:
#include "fvCFD.H" #include "Classes/classA.H" int main(int argc, char *argv[]) { A A_(2.0); Info << A_.f(2.0) << endl; return 0; } Code:
test_wmake.C Classes/classA.C Classes/classB/classB.C EXE = $(FOAM_USER_APPBIN)/test_wmake Code:
EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ EXE_LIBS = \ -lfiniteVolume \ -lgenericPatchFields Code:
#ifndef CLASSA_H #define CLASSA_H #include "classB/classB.H" namespace Foam { class A { public: A(const double inX); ~A(); double f(const double x) const; private: mutable B B_; }; } #endif // CLASSA_H Code:
#include "classA.H" namespace Foam { A::A(const double inX) : B_(inX) {} A::~A() {} double A::f(const double x) const { return B_.f(x); } } Code:
#ifndef CLASSB_H #define CLASSB_H namespace Foam { class B { public: B(const double inY); ~B(); double f(const double x) const; private: double y_; }; } #endif // CLASSB_H Code:
#include "classB.H" namespace Foam { B::B(const double inY) : y_(inY) {} B::~B() {} double B::f(const double x) const { return x*y_; } } Code:
Making dependency list for source file test_wmake.C could not open file classB/classB.H for source file test_wmake.C due to No such file or directory Making dependency list for source file Classes/classA.C Making dependency list for source file Classes/classB/classB.C SOURCE=test_wmake.C ; g++ -m64 -std=c++0x -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/thanasis/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/thanasis/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/home/thanasis/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc++0xDPOpt/test_wmake.o SOURCE=Classes/classA.C ; g++ -m64 -std=c++0x -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/thanasis/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/thanasis/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/home/thanasis/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc++0xDPOpt/classA.o SOURCE=Classes/classB/classB.C ; g++ -m64 -std=c++0x -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/thanasis/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/thanasis/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/home/thanasis/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc++0xDPOpt/classB.o g++ -m64 -std=c++0x -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/thanasis/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/thanasis/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/home/thanasis/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed Make/linux64Gcc++0xDPOpt/test_wmake.o Make/linux64Gcc++0xDPOpt/classA.o Make/linux64Gcc++0xDPOpt/classB.o -L/home/thanasis/OpenFOAM/OpenFOAM-2.3.x/platforms/linux64Gcc++0xDPOpt/lib \ -lfiniteVolume -lgenericPatchFields -lOpenFOAM -ldl -lm -o /home/thanasis/OpenFOAM/thanasis-2.3.x/platforms/linux64Gcc++0xDPOpt/bin/test_wmake I am using openFoam 2.3.x which I compiled in ubuntru 14.04 using the Gcc++0x 4.8.2 compiler. Any thoughts are mostly welcome! |
|
Tags |
subdirectories, wmake |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM 1.7.1 installation problem on OpenSUSE 11.3 | flakid | OpenFOAM Installation | 16 | December 28, 2010 09:48 |
Problems Installing OF 1.6 32 bit | bucksfan | OpenFOAM Installation | 19 | August 4, 2009 02:36 |
OpenFOAM15 installables are incomplete problem with paraFoam | tryingof | OpenFOAM Bugs | 17 | December 7, 2008 05:41 |
Problem of compilation OF 14Allwmake command not found | erik_d | OpenFOAM Bugs | 13 | September 13, 2008 22:45 |
[OpenFOAM] ParaFoam error message | joey | ParaView | 1 | October 2, 2006 14:28 |