CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2

Trouble adding files with Makefile.am

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 25, 2019, 01:17
Default Trouble adding files with Makefile.am
  #1
New Member
 
Join Date: Sep 2016
Posts: 3
Rep Power: 10
asdfasdf is on a distinguished road
Hi all,

I am trying to add an .hpp and .cpp file to Common/include and Common/src, but am have trouble building SU2. I'm 99% sure the issue lies within my Common/lib/Makefile.am. I've edited Makefile.am to list my added files and I have gone through the autotools documentation a few times, but still not sure what I'm doing wrong.

The error I get when trying to make SU2 is:
make[1]: *** No rule to make target '../src/MYNEWFILE.cpp', needed by '../src/libSU2Core_a-MYNEWFILE.o'. Stop.
Makefile:441: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

My procedure for building everything is as follows:
$ ./bootstrap (according to the documentation this will also call autreconf and remake Configuration and Makefile.in 's )
$ ./configure --prefix=/home/user/Documents/SU2-6.2.0 CXXFLAGS="-O3" --enable-mpi --with-cc=/usr/bin/mpicc --with-cxx=/usr/bin/mpicxx
$ make -j 16 install

Could someone please give me a very explicit example of editing Makefile.am and re-building SU2?

Thank you

Last edited by asdfasdf; June 25, 2019 at 01:19. Reason: too much whitespace
asdfasdf is offline   Reply With Quote

Old   June 30, 2019, 00:27
Default
  #2
New Member
 
Join Date: Sep 2016
Posts: 3
Rep Power: 10
asdfasdf is on a distinguished road
Update:


Took my code from Ubuntu 16.04 to a CentOS 7 machine and everything compiled just fine. I don't understand why its working now, but I'm not complaining
asdfasdf is offline   Reply With Quote

Old   July 1, 2019, 19:01
Default
  #3
pcg
Senior Member
 
Pedro Gomes
Join Date: Dec 2017
Posts: 466
Rep Power: 14
pcg is on a distinguished road
Always good to do a "make clean" after changes to make files, just in case...
pcg is offline   Reply With Quote

Old   July 15, 2019, 21:03
Default
  #4
hlk
Senior Member
 
Heather Kline
Join Date: Jun 2013
Posts: 309
Rep Power: 14
hlk is on a distinguished road
Quote:
Originally Posted by asdfasdf View Post
Update:


Took my code from Ubuntu 16.04 to a CentOS 7 machine and everything compiled just fine. I don't understand why its working now, but I'm not complaining

What the error you had often indicates is that the object (*.o) files from a previous compilation are confusing the compiler because of a change in the dependencies between files. The compiler will often not recompile an object if it's source hasn't been updated - but as you have found this can miss things when there is a new file dependency that was not there before. You can get around this either by using 'make clean' as a previous commentor stated (which removes ALL the object files), or by deleting just the .o file that's causing the problem if you'd like to try and save some time during the compilation process. Using 'make clean' is generally the safer bet. You can also use 'touch filename.cpp' to update the timestamp on the files giving the errors and trick the compiler into thinking it's been updated recently.
hlk is offline   Reply With Quote

Reply

Tags
automake, autotools, su2


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
chtMultiRegionSimpleFoam 3D problem Lucie OpenFOAM Pre-Processing 2 June 21, 2016 06:23
UDF help for Rapid compression machine ECM. sanjeetlimbu Fluent UDF and Scheme Programming 0 March 17, 2015 23:45
Help with chtMultiRegionFoam jbvw96 OpenFOAM Running, Solving & CFD 2 December 26, 2010 18:16
Results saving in CFD hawk Main CFD Forum 16 July 21, 2005 21:51
Merging .msh files in TGrid Raza Mirza FLUENT 2 January 18, 2001 19:09


All times are GMT -4. The time now is 16:05.