avasyukov / gcm-3d

GCM engine for 3d problems
8 stars 10 forks source link

CONFIG_SHARE_GCM is an empty directory after installation (make install) #53

Closed grim-yawn closed 8 years ago

grim-yawn commented 8 years ago
#Maybe·you should·add·this·to CMakeLists.txt:
 install(
 ····FILES·src/launcher/log4cxx.properties·DESTINATION·${CMAKE_CONFIG_SHARE_GCM}
 )
Because gcm's launcher looks for this file in that directory.
        fls.addPath(CONFIG_SHARE_GCM);
        if( dataDir.empty() )
            dataDir = CONFIG_SHARE_GCM;
        fls.addPath(dataDir);
        fls.addPath("./src/launcher/");
        ................
        #if CONFIG_ENABLE_LOGGING
        char pe[5];
        sprintf(pe, "%d", world.rank());
        log4cxx::MDC::put("PE", pe);
        log4cxx::PropertyConfigurator::configure(fls.lookupFile("log4cxx.properties"));
        #endif
fufler commented 8 years ago

Well, actually it's not supposed to be installed at the moment. The most common use scenario is the following:

mkdir -p build
cd build
cmake ..
make
cd -
./build/gcm3d ...

This

fls.addPath("./src/launcher/");

provides a way to load standard log4cxx configuration file when using described scenario.

But anyway I do not see any problem with CONFIG_SHARE_GCM:

❯ rm -rf build
❯ mkdir build
❯ cd build
build❯ cmake ..
-- The C compiler identification is GNU 6.1.1
-- The CXX compiler identification is GNU 6.1.1
...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/lx/work/mipt/gcm-3d/build
build❯ grep SHARE generated_sources/libgcm/config.hpp#define CONFIG_SHARE_GCM
"/usr/local/share/gcm3d"
grim-yawn commented 8 years ago

Yes, CONFIG_SHARE_GCM is not empty string, but directory /usr/local/share/gcm3d does not exist. P.S. It's working only when program working directory is 'gcm-3d'. fls.addPath("./src/launcher/");

fufler commented 8 years ago

Yes, CONFIG_SHARE_GCM is not empty string, but directory /usr/local/share/gcm3d does not exist.

Exactly. Because this path should be created when make install is invoked, but as I said earlier installation is not working at the moment (or at least is completely untested).

P.S. It's working only when program working directory is 'gcm-3d'. fls.addPath("./src/launcher/");

That's why I said about most common use scenario. gcm3d searches for log4cxx configuration at following paths:

So, to sum things up: it's done this way because it covers the most common usage scenario. I'm not saying it's perfect, but it works. Feel free to send a pull request if you're ready to get rid of this (to tell the truth) hardcoded path.

grim-yawn commented 8 years ago

I understood. Thank you!