adding a new problem

36 views
Skip to first unread message

Knut Heidemann

unread,
Apr 29, 2020, 5:19:27 AM4/29/20
to PSOPT users group
Hi,

I just started to use PSOPT and so far only manipulated the *.cxx file in the "user" example. My problem gets solved nicely.

Then I tried to set up a stand alone project (with its own dir) by, first, simply copying the user folder (to user2 for example), adding

user2:
    (cd $(EXAMPLESDIR)/$@; make $@)

to the makefile and execute "make user2". The makefile in the example dir looks as follows:

include ../Makefile_linux.inc

USER2 = user2   $(SNOPT_WRAPPER)

USER2_O = $(USER2:%=$(EXAMPLESDIR)/%.o)


user2: $(USER2_O) $(PSOPT_LIBS) $(DMATRIX_LIBS) $(SPARSE_LIBS)
    $(CXX) $(CXXFLAGS) $^ -o $@ -L$(LIBDIR) $(ALL_LIBRARIES) $(LDFLAGS)
    rm -f *.o


This does not work though. I get lots of undefined references:

undefined reference to `adouble::adouble(adouble const&)' etc.

So I guess I did not link correctly.

So my question is:

Question: How do I add/link a new problem to PSOPT?

(Please excuse my very basic question. I am not using compiled languages very much these days, except under the hood.)

Best, –Knut.

Romain Guicherd

unread,
Apr 29, 2020, 5:59:32 AM4/29/20
to PSOPT users group
Hello Knut,
If you create a copy of your folder "user" within the examples directory and simply rename this new folder "user2", you should be able to compile and execute the same source code (script "user.cxx" in the new folder "user2") without changing the Makefile, or anything else for that matter! However, if you rename the script "user.cxx", say to "user2.cxx" then you will also have to update the Makefile accordingly!

Hope that helps

Romain

Knut Heidemann

unread,
Apr 29, 2020, 11:08:50 AM4/29/20
to PSOPT users group
Dear Romain,

Thanks for your reply. The problem is solved. I had a typo in my makefile, funny it did something at all.

Kind regards,
–Knut.
Reply all
Reply to author
Forward
0 new messages