Re: [petsc-users] Makefile for mixed C++ and Fortran code

2018-06-03 Thread Satish Balay
Glad it works. Thanks for the update. Satish On Sun, 3 Jun 2018, Danyang Su wrote: > Hi Satish, > > Your makefile works. > > Please ignore the CGAL dependency. I just modified from CGAL example and it > needs to be further optimized with the dependency that is required for the > algorithm I

Re: [petsc-users] Makefile for mixed C++ and Fortran code

2018-06-03 Thread Danyang Su
Hi Satish, Your makefile works. Please ignore the CGAL dependency. I just modified from CGAL example and it needs to be further optimized with the dependency that is required for the algorithm I use. Thanks, Danyang On 18-06-02 02:51 PM, Satish Balay wrote: Try the attached makefile.

Re: [petsc-users] Makefile for mixed C++ and Fortran code

2018-06-02 Thread Satish Balay
Try the attached makefile. [with correct PETSC_DIR and PETSC_ARCH values] If you have issues - send the complete makefiles - and complete error log.. On Sat, 2 Jun 2018, Danyang Su wrote: > Hi Barry, > > For the code without PETSc, the rules used to compile the code with CGAL is note: DLIB

Re: [petsc-users] Makefile for mixed C++ and Fortran code

2018-06-02 Thread Danyang Su
Hi Barry, For the code without PETSc, the rules used to compile the code with CGAL is DLIB = -lstdc++ -lmetis -lm -L/usr/local/lib -rdynamic /usr/local/lib/libmpfr.so /usr/local/lib/libgmp.so /usr/local/lib/libCGAL_ImageIO.so.11.0.1 /usr/local/lib/libCGAL.so.11.0.1

Re: [petsc-users] Makefile for mixed C++ and Fortran code

2018-06-01 Thread Danyang Su
On 18-06-01 10:29 AM, Smith, Barry F. wrote: What happens if you add ${DLIB} to the end of the line executable: $(SOURCES) chkopts -${FLINKER} $(FFLAGS) $(FPPFLAGS) $(CPPFLAGS) -o executable.out $(SOURCES) ${PETSC_LIB} Send all the output from trying this. Barry Thanks,

Re: [petsc-users] Makefile for mixed C++ and Fortran code

2018-06-01 Thread Smith, Barry F.
You need to determine exactly what flags are passed to the C++ compiler for your compile that works and make sure those same flags are used in "PETSc version" of the makefile. You could add the flags directly to the rule > %.o:%.cpp >$(CLINKER) $(CXXFLAGS) $(CPPFLAGS) -c

Re: [petsc-users] Makefile for mixed C++ and Fortran code

2018-06-01 Thread Danyang Su
Follow up: With following command executable: $(SOURCES) chkopts -${FLINKER} $(FFLAGS) $(FPPFLAGS) $(CPPFLAGS) -o executable.out $(SOURCES) ${PETSC_LIB} %.o:%.F90 $(FLINKER) $(FFLAGS) $(FPPFLAGS) -c -frounding-math $< -o $@ %.o:%.cpp $(CLINKER) $(CXXFLAGS) $(CPPFLAGS) -c

Re: [petsc-users] Makefile for mixed C++ and Fortran code

2018-06-01 Thread Smith, Barry F.
What happens if you add ${DLIB} to the end of the line > executable: $(SOURCES) chkopts >-${FLINKER} $(FFLAGS) $(FPPFLAGS) $(CPPFLAGS) -o executable.out > $(SOURCES) ${PETSC_LIB} Send all the output from trying this. Barry > On Jun 1, 2018, at 12:07 PM, Danyang Su wrote: >

[petsc-users] Makefile for mixed C++ and Fortran code

2018-06-01 Thread Danyang Su
Hi All, My code needs to link to an external C++ library (CGAL). The code is written in Fortran and I have already written interface to let Fortran call C++ function. For the sequential version without PETSc, it can be compiled without problem using the following makefile. The parallel