Problem with example

30 views
Skip to first unread message

larryh...@gmail.com

unread,
Jan 23, 2017, 5:37:56 PM1/23/17
to QUESO-users mailing list


Hi,

I was trying to create my own makefile to run the example, as described in user's manual page 61, . This is my makefile:

QUESO_DIR = /project/xfu/apps/queso-0.56.1
BOOST_DIR = /share/apps/boost-1.57
GSL_DIR = /project/cacds/apps/gsl/1.16

INC_PATHS = -I$(QUESO_DIR)/include -I$(BOOST_DIR)/include/boost -I$(GSL_DIR)/include/gsl

LIBS = \
-L$(QUESO_DIR)/lib -lqueso \
-L$(BOOST_DIR)/lib -lboost_program_options \
-L$(GSL_DIR)/lib -lgsl 

CXX = mpic++
CXXFLAGS += -g -Wall -c

default : all
.SUFFIXES : .o .C
all : example_sip
clean :
    rm -f *~
    rm -f *.o
    rm -f simple_sip_example

example_sip : example_main.o example_likelihood.o example_compute.o
    $(CXX) example_main.o \
           example_likelihood.o \
           example_compute.o \
           -o simple_sip_example $(LIBS)
%.o: %.C
    $(CXX) $(INC_PATHS) $(CXXFLAGS)  $<

Then I got these errors:

mpic++ -I/project/xfu/apps/queso-0.56.1/include -I/share/apps/boost-1.57/include/boost 
-I/project/cacds/apps/gsl/1.16/include/gsl -g -Wall -c 
-L/project/xfu/apps/queso-0.56.1/lib -lqueso -L/share/apps/boost-1.57/lib 
-lboost_program_options -L/project/cacds/apps/gsl/1.16/lib -lgsl  example_main.C
In file included from /project/xfu/apps/queso-0.56.1/include/queso/Environment.h:38,
             from example_compute.h:28,
             from example_main.C:25:
/project/xfu/apps/queso-0.56.1/include/queso/ScopedPtr.h:44: error: ISO C++ forbids declaration of 'unique_ptr' with no type
/project/xfu/apps/queso-0.56.1/include/queso/ScopedPtr.h:44: error: typedef name may not be a nested-name-specifier
/project/xfu/apps/queso-0.56.1/include/queso/ScopedPtr.h:44: error: expected ';' before '<' token
In file included from example_compute.h:28,
             from example_main.C:25:
/project/xfu/apps/queso-0.56.1/include/queso/Environment.h:380: error: 'Type' in class 'QUESO::ScopedPtr<QUESO::GetPot>' does not name a type
make: *** [example_main.o] Error 1

Is there anything wrong with my Makefile? How can I solve it?
Thank you very much!

Damon McDougall

unread,
Jan 25, 2017, 9:41:00 AM1/25/17
to larryh...@gmail.com, QUESO-users mailing list
INC_PATHS doesn't look quite right. I think it should be:

INC_PATHS = -I$(QUESO_DIR)/include -I$(BOOST_DIR)/include
-I$(GSL_DIR)/include

Can you try that? It's trying to use the boost implementation for
ScopedPtr, so I have a sneaking suspicion that INC_PATHS is the problem.

> Thank you very much!
>
> --
> You received this message because you are subscribed to the Google Groups
> "QUESO-users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to queso-users...@googlegroups.com.
> Visit this group at https://groups.google.com/group/queso-users.
> For more options, visit https://groups.google.com/d/optout.


--
Damon McDougall
http://dmcdougall.co.uk
Institute for Computational Engineering Sciences
201 E. 24th St., Stop C0200
The University of Texas at Austin
Austin, TX 78712-1229

Paul T. Bauman

unread,
Jan 25, 2017, 9:56:07 AM1/25/17
to queso...@googlegroups.com
Sorry, we didn't reply-all in the correspondence (my bad). I believe this is resolved.

On Tue, Jan 24, 2017 at 1:34 PM, Han Lu <larryh...@gmail.com> wrote:
Hi Paul,

Thank you very much for your reply! It help a lot.
I updated the gcc and rebuilt the library, it works with this example now.

Thanks,
Best regards,
Han

Best regards,
Han

On Mon, Jan 23, 2017 at 9:19 PM, Paul T. Bauman <ptba...@gmail.com> wrote:
Hello,

Thanks for your interest in QUESO!

Are your CXXFLAGS consistent with how you configured QUESO? More to the point, we detect at configure time whether your not your compiler supports C++11 and, if so, we use it. It looks like your CXXFLAGS do not include -std=c++11, but based on your error message, I'm guessing that QUESO was configured and built as such.

Have a look at your configure output from QUESO being built. There should be a line "C++ Compiler Flags:  ..." I would suggest you use those same flags when building your QUESO-based application.

If you're still having trouble, please lets us know your environment, compiler version, version of QUESO and the output of configure.

Best

Paul

--
You received this message because you are subscribed to the Google Groups "QUESO-users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to queso-users+unsubscribe@googlegroups.com.

larryh...@gmail.com

unread,
Jan 25, 2017, 11:07:18 AM1/25/17
to QUESO-users mailing list, larryh...@gmail.com
Hi Damon,

Thank you for your reply. The library worked after I updating gcc compiler and rebuilt the library. I just modified the Makefile as you said, it generates the same output data as the previous version, so I guess the including path is not the problem.

Thanks,
Best regards,
Han
Reply all
Reply to author
Forward
0 new messages