including .cpp files is broken for nobs build

Issue #14 resolved
Steven Hofmeyr created an issue

If a file has a #include of another file, the compilation doesn't work correctly. e.g. if we have a file meep.cpp with

int meep(void) { return 1; }

and a file beep.cpp with

#include "meep.cpp"

then we get an error of multiple definition of meep()

And if upcxx:: is used in the included file, it is not recognized, so if beep.cpp has

#include <upcxx/upcxx.hpp>

and in meep.cpp we have

upcxx::future<int> f;

then we get the error

‘upcxx’ has not been declared

Note: this used to work just fine a few days ago. Not sure what commit broke it.

Comments (6)

  1. Former user Account Deleted

    I will fix this, but cpp's including other cpp's is not hygienic. beep.cpp should include meep.hpp. Nobs will see that and launch a separate compile for meep.cpp automatically and link both beep.o and meep.o together.

  2. Former user Account Deleted

    I will fix this, but cpp's including other cpp's is not hygienic. beep.cpp should include meep.hpp. Nobs will see that and launch a separate compile for meep.cpp automatically and link both beep.o and meep.o together.

  3. Log in to comment