On 2012-09-29 06:46-0700 phil rosenberg wrote: > Hi Alan > Sorry to bump this, did you ever look at the patch I submitted for static > runtime linkage? If you are happy with it then I can update the MSVC++ build > instructions on the wiki page.
Hi Phil: I have no problem with anyone reminding us of stuff that is in danger of getting lost on the mailing list. I don't recall exactly what happened in this case, but probably I just silently left it to Arjen to deal with since he is in a good position to test your patch on the Windows platform. Arjen, if you haven't dealt with this already, would you be willing to take a look? Alan > > > ________________________________ > From: phil rosenberg <philip_rosenb...@yahoo.com> > To: Alan W. Irwin <ir...@beluga.phys.uvic.ca> > Cc: Arjen Markus <arjen.mar...@deltares.nl>; > "plplot-devel@lists.sourceforge.net" <plplot-devel@lists.sourceforge.net> > Sent: Saturday, 1 September 2012, 0:23 > Subject: Re: [Plplot-devel] Building examples on Windows > > > Hi Alan > Thanks for the suggestions. Using the environment variables seems to work for > unicode, but not for the static linkage. When I refer to static linkage I > mean linkage with the static/dynamic linked runtime library, rather than > internal static linkage to generate a .lib rather than a .dll. > A bit more googling actually found this item > http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F > I've basically taken that code snippet and added it to the cmakelists.txt > file for the c/c++ examples, src, c++, wxwidgets, csa and qsastime > directories. For csa and qsastime I had to change CXX_FLAGS to C_FLAGS, but > doing this for the src and c examples actually stopped the change working in > these cases - I'm not sure why. I've wrapped the changes in an > if(STATIC_RUNTIME). I'm not sure if the code should be added anywhere else. > > I've attached a patch so you can see exactly what I've done. Unfortunately I > have no experience with writing CMAKE files so I'm not sure if I've added the > code in a sensible place - but it works. > > One other item I noticed. the qsastime and csa libraries don't get the tag > appended. Is this by design? > > Phil > > > ________________________________ > From: Alan W. Irwin <ir...@beluga.phys.uvic.ca> > To: phil rosenberg <philip_rosenb...@yahoo.com> > Cc: Arjen Markus <arjen.mar...@deltares.nl>; > "plplot-devel@lists.sourceforge.net" <plplot-devel@lists.sourceforge.net> > Sent: Friday, 31 August 2012, 19:47 > Subject: Re: [Plplot-devel] Building examples on Windows > > On 2012-08-31 07:04-0700 phil rosenberg wrote: > >> I think I've found the problem, but haven't properly solved it. >> >> I am using -DCMAKE_CXX_FLAGS_RELEASE="/MT" and >> -DCMAKE_CXX_FLAGS_DEBUG="/MTd" and the C versions of these flags to specify >> static linkage. I found that adding /DNDEBUG to the release versions of the >> flags cured my problem. >> >> However I've also recently tried building with unicode enabled, but using >> -DCMAKE_CXX_FLAGS="/D UNICODE /D _UNICODE". this caused me build errors that >> I narrowed down to not having WIN32 defined! >> >> It seems that defining these flags on the > command line is overriding the "normal" linker flags rather than adding to > them. am I doing something wrong and is there a better way to do this? > > Hi Phil: > > I never bother with the CMake CMAKE_BUILD_TYPE flag or set > CMAKE_<LANG>_FLAGS_<CONFIG> CMake options, where CONFIG is RELEASE, > DEBUG, etc. But perhaps the problem is you should be using > CMAKE_EXE_LINKER_FLAGS_[CMAKE_BUILD_TYPE] (see documentation) to > specify linker flags? Or you may have found a CMake bug > in how one (or some) of the CMAKE_<LANG>_FLAGS_<CONFIG> are implemented > so there is inappropriate leakage of the flag to the link step? > > What always works for me is to use the default CMAKE_BUILD_TYPE and > simply set the environment variables CFLAGS, CXXFLAGS, and FFLAGS to > whatever I like for the current build > > I am currently using > > CXXFLAGS=-O3 -fvisibility=hidden > CFLAGS=-O3 > -fvisibility=hidden > FFLAGS=-O3 > > with no problems. But I often use something much more complicated or > something very simple. However, I don't know how to set linker flags > with this environment variable approach. > > With regard to your use case, if all you are concerned about is static > linking of the internal PLplot libraries and executables amongst > themselves, then setting -DBUILD_SHARED_LIBS=OFF will do the trick. > But that doesn't deal with the case of how PLplot libraries and > executables are linked with external libraries, and if you want that > linking to be static as well then you should look at the documentation > of the CMake target property LINK_SEARCH_START_STATIC. You cannot set > target properties directly from the cmake command line, but if you > modify src/CMakeLists.txt files to set that target property for, say, > the plplotd library, and it works for you, then we could set up > a > command-line option (called, say, EXTERNAL_STATIC_LINKING). If the > user specifies that option as ON then we could change our current > build system so that wherever that system creates libraries or > executables, the CMake logic to set the corresponding target property > LINK_SEARCH_START_STATIC would also be executed. > > Alan > __________________________ > Alan W. Irwin > > Astronomical research affiliation with Department of Physics and Astronomy, > University of Victoria (astrowww.phys.uvic.ca). > > Programming affiliations with the FreeEOS equation-of-state > implementation for stellar interiors (freeeos.sf.net); the Time > Ephemerides project (timeephem.sf.net); PLplot scientific plotting > software package (plplot.sf.net); the libLASi project > (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); > and the Linux Brochure Project (lbproject.sf.net). > __________________________ > > Linux-powered > Science > __________________________ __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------------ How fast is your code? 3 out of 4 devs don\\\'t know how their code performs in production. Find out how slow your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219672;13503038;z? http://info.appdynamics.com/FreeJavaPerformanceDownload.html _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel