<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>miscellaneous.debris &#187; Windows</title>
	<atom:link href="http://www.miscdebris.net/blog/category/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.miscdebris.net/blog</link>
	<description>A blog about my research work, computer and internet stuff, personal life.</description>
	<lastBuildDate>Mon, 21 Jun 2010 21:28:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>cmake module to find Gnu Scientific Library, FindGSL.cmake</title>
		<link>http://www.miscdebris.net/blog/2010/06/21/cmake-module-to-find-gnu-scientific-library-findgsl-cmake/</link>
		<comments>http://www.miscdebris.net/blog/2010/06/21/cmake-module-to-find-gnu-scientific-library-findgsl-cmake/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 21:27:19 +0000</pubDate>
		<dc:creator>Werner</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[cmake]]></category>
		<category><![CDATA[gsl]]></category>

		<guid isPermaLink="false">http://www.miscdebris.net/blog/?p=233</guid>
		<description><![CDATA[There is no official FindGSL.cmake module in the cmake distribution to &#8220;automagically&#8221; find the Gnu Scientific Library on Windows, Linux and Mac OS X. I have written such a module which works for my configurations, but might not cover all GSL installation on all OS. But you can modify it to fit your needs. Anyway, [...]]]></description>
			<content:encoded><![CDATA[<p>There is no official FindGSL.cmake module in the cmake distribution to &#8220;automagically&#8221; find the Gnu Scientific Library on Windows, Linux and Mac OS X. I have written such a module which works for my configurations, but might not cover all GSL installation on all OS. But you can modify it to fit your needs.</p>
<p><span id="more-233"></span></p>
<p>Anyway, below you&#8217;ll find the source code of my FindGSL.cmake module.</p>
<pre class="brush: plain;">
# Try to find gnu scientific library GSL
# See
# http://www.gnu.org/software/gsl/  and
# http://gnuwin32.sourceforge.net/packages/gsl.htm
#
# Based on a script of Felix Woelk and Jan Woetzel
# (www.mip.informatik.uni-kiel.de)
#
# It defines the following variables:
#  GSL_FOUND - system has GSL lib
#  GSL_INCLUDE_DIRS - where to find headers
#  GSL_LIBRARIES - full path to the libraries
#  GSL_LIBRARY_DIRS, the directory where the PLplot library is found.

#  CMAKE_GSL_CXX_FLAGS  = Unix compiler flags for GSL, essentially &quot;`gsl-config --cxxflags`&quot;
#  GSL_LINK_DIRECTORIES = link directories, useful for rpath on Unix
#  GSL_EXE_LINKER_FLAGS = rpath on Unix

set( GSL_FOUND OFF )
set( GSL_CBLAS_FOUND OFF )

# Windows, but not for Cygwin and MSys where gsl-config is available
if( WIN32 AND NOT CYGWIN AND NOT MSYS )
	# look for headers
  find_path( GSL_INCLUDE_DIR
    NAMES gsl/gsl_cdf.h gsl/gsl_randist.h
    )
  if( GSL_INCLUDE_DIR )
  	# look for gsl library
    find_library( GSL_LIBRARY
      NAMES gsl
    )
    if( GSL_LIBRARY )
      set( GSL_INCLUDE_DIRS ${GSL_INCLUDE_DIR} )
      get_filename_component( GSL_LIBRARY_DIRS ${GSL_LIBRARY} PATH )
      set( GSL_FOUND ON )
    endif( GSL_LIBRARY )

		# look for gsl cblas library
    find_library( GSL_CBLAS_LIBRARY
        NAMES gslcblas
      )
    if( GSL_CBLAS_LIBRARY )
      set( GSL_CBLAS_FOUND ON )
    endif( GSL_CBLAS_LIBRARY )

    set( GSL_LIBRARIES ${GSL_LIBRARY} ${GSL_CBLAS_LIBRARY} )
  endif( GSL_INCLUDE_DIR )

  mark_as_advanced(
    GSL_INCLUDE_DIR
    GSL_LIBRARY
    GSL_CBLAS_LIBRARY
  )
else( WIN32 AND NOT CYGWIN AND NOT MSYS )
  if( UNIX OR MSYS )
		find_program( GSL_CONFIG_EXECUTABLE gsl-config
			/usr/bin/
			/usr/local/bin
		)

		if( GSL_CONFIG_EXECUTABLE )
			set( GSL_FOUND ON )

      # run the gsl-config program to get cxxflags
      execute_process(
        COMMAND sh &quot;${GSL_CONFIG_EXECUTABLE}&quot; --cflags
        OUTPUT_VARIABLE GSL_CFLAGS
        RESULT_VARIABLE RET
        ERROR_QUIET
        )
      if( RET EQUAL 0 )
        string( STRIP &quot;${GSL_CFLAGS}&quot; GSL_CFLAGS )
        separate_arguments( GSL_CFLAGS )

        # parse definitions from cflags; drop -D* from CFLAGS
        string( REGEX MATCHALL &quot;-D[^;]+&quot;
          GSL_DEFINITIONS  &quot;${GSL_CFLAGS}&quot; )
        string( REGEX REPLACE &quot;-D[^;]+;&quot; &quot;&quot;
          GSL_CFLAGS &quot;${GSL_CFLAGS}&quot; )

        # parse include dirs from cflags; drop -I prefix
        string( REGEX MATCHALL &quot;-I[^;]+&quot;
          GSL_INCLUDE_DIRS &quot;${GSL_CFLAGS}&quot; )
        string( REPLACE &quot;-I&quot; &quot;&quot;
          GSL_INCLUDE_DIRS &quot;${GSL_INCLUDE_DIRS}&quot;)
        string( REGEX REPLACE &quot;-I[^;]+;&quot; &quot;&quot;
          GSL_CFLAGS &quot;${GSL_CFLAGS}&quot;)

        message(&quot;GSL_DEFINITIONS=${GSL_DEFINITIONS}&quot;)
        message(&quot;GSL_INCLUDE_DIRS=${GSL_INCLUDE_DIRS}&quot;)
        message(&quot;GSL_CFLAGS=${GSL_CFLAGS}&quot;)
      else( RET EQUAL 0 )
        set( GSL_FOUND FALSE )
      endif( RET EQUAL 0 )

      # run the gsl-config program to get the libs
      execute_process(
        COMMAND sh &quot;${GSL_CONFIG_EXECUTABLE}&quot; --libs
        OUTPUT_VARIABLE GSL_LIBRARIES
        RESULT_VARIABLE RET
        ERROR_QUIET
        )
      if( RET EQUAL 0 )
        string(STRIP &quot;${GSL_LIBRARIES}&quot; GSL_LIBRARIES )
        separate_arguments( GSL_LIBRARIES )

        # extract linkdirs (-L) for rpath (i.e., LINK_DIRECTORIES)
        string( REGEX MATCHALL &quot;-L[^;]+&quot;
          GSL_LIBRARY_DIRS &quot;${GSL_LIBRARIES}&quot; )
        string( REPLACE &quot;-L&quot; &quot;&quot;
          GSL_LIBRARY_DIRS &quot;${GSL_LIBRARY_DIRS}&quot; )
      else( RET EQUAL 0 )
        set( GSL_FOUND FALSE )
      endif( RET EQUAL 0 )

			MARK_AS_ADVANCED(
				GSL_CFLAGS
			)
			message( STATUS &quot;Using GSL from ${GSL_PREFIX}&quot; )
		else( GSL_CONFIG_EXECUTABLE )
			message( STATUS &quot;FindGSL: gsl-config not found.&quot;)
		endif( GSL_CONFIG_EXECUTABLE )
	endif( UNIX OR MSYS )
endif( WIN32 AND NOT CYGWIN AND NOT MSYS )

if( GSL_FOUND )
  if( NOT GSL_FIND_QUIETLY )
    message( STATUS &quot;FindGSL: Found both GSL headers and library&quot; )
  endif( NOT GSL_FIND_QUIETLY )
else( GSL_FOUND )
  if( GSL_FIND_REQUIRED )
    message( FATAL_ERROR &quot;FindGSL: Could not find GSL headers or library&quot; )
  endif( GSL_FIND_REQUIRED )
endif( GSL_FOUND )
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.miscdebris.net/blog/2010/06/21/cmake-module-to-find-gnu-scientific-library-findgsl-cmake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding GDI+ headers to MinGW (to compile wxWidgets with wxGraphicsContext support)</title>
		<link>http://www.miscdebris.net/blog/2009/09/17/adding-gdi-headers-to-mingw-to-compile-wxwidgets-with-wxgraphicscontext-support/</link>
		<comments>http://www.miscdebris.net/blog/2009/09/17/adding-gdi-headers-to-mingw-to-compile-wxwidgets-with-wxgraphicscontext-support/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 09:10:00 +0000</pubDate>
		<dc:creator>Werner</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[mingw]]></category>
		<category><![CDATA[wxWidgets]]></category>

		<guid isPermaLink="false">http://www.miscdebris.net/blog/?p=144</guid>
		<description><![CDATA[The GDI+ library is mandatory for wxGraphicsContext support on Win32. This is no problem if you&#8217;re using Visual C++, since the SDK provides the headers and import libraries, but for MinGW there are no such headers and import libraries provided. But there are some sources on the internet where you can get the necessary files. [...]]]></description>
			<content:encoded><![CDATA[<p>The GDI+ library is mandatory for wxGraphicsContext support on Win32. This is no problem if you&#8217;re using Visual C++, since the SDK provides the headers and import libraries, but for MinGW there are no such headers and import libraries provided. But there are some sources on the internet where you can get the necessary files.</p>
<p><span id="more-144"></span></p>
<p>Elaborate instructions to convert files from the Visual C++ SDK for MinGW usage can be found @ <a href="http://wiki.bb4win.org/wiki/Using_GDIPlus_With_MinGW" target="_blank">http://wiki.bb4win.org/wiki/Using_GDIPlus_With_MinGW</a> while <a href="http://lists-archives.org/mingw-users/08437-contributing-gdi-headers.html" target="_blank">here</a> you can follow a discussion about an unsuccessful contribution to MinGW (and see what difficulties such projects have).</p>
<p>The most easiest solution seem to be the files provided by <a href="http://code.google.com/p/wxmax/" target="_blank">wxmax</a> (BlitzMax bindings for wxWidgets) where a zip file containing headers and import library (already altered for MinGW usage) is <a href="http://code.google.com/p/wxmax/downloads/detail?name=gdiplus_includes.zip&amp;can=2&amp;q=" target="_blank">available for download</a> (<a href="http://www.miscdebris.net/upload/gdiplus_includes.zip" target="_self">local copy</a>). Just copy the files from the &#8220;include&#8221; directory into C:\MinGW\include (or wherever your MinGW files are) and the file from the &#8220;lib&#8221; directory into C:\MinGW\lib.</p>
<p>This should be enough to so that MinGW can compile wxWidgets with GDI+ support, e.g.</p>
<pre>cd %WXWIN%\build\msw
mingw32-make -f makefile.gcc BUILD=release SHARED=1 USE_GDIPLUS=1
set PATH=%WXWIN%\lib\gcc_dll;%PATH%
cd %WXWIN%\samples\drawing
mingw32-make -f makefile.gcc BUILD=release SHARED=1 USE_GDIPLUS=1
gcc_mswdll\drawing.exe</pre>
<p>And voila!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.miscdebris.net/blog/2009/09/17/adding-gdi-headers-to-mingw-to-compile-wxwidgets-with-wxgraphicscontext-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MinGW (3.4.5) binaries of GNU Scientific Library 1.11 for use with MinGW and Visual C</title>
		<link>http://www.miscdebris.net/blog/2008/12/12/mingw-345-binaries-of-gnu-scientific-library-111/</link>
		<comments>http://www.miscdebris.net/blog/2008/12/12/mingw-345-binaries-of-gnu-scientific-library-111/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 10:05:37 +0000</pubDate>
		<dc:creator>Werner</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[gsl]]></category>
		<category><![CDATA[mingw]]></category>

		<guid isPermaLink="false">http://www.miscdebris.net/blog/?p=85</guid>
		<description><![CDATA[The binaries for GSL 1.12 are provided in this post: MinGW (3.4.5) binaries of GNU Scientific Library 1.12 for use with MinGW and Visual C++ &#8220;The GNU Scientific Library (GSL) is a numerical library for C and C++ programmers. The library provides a wide range of mathematical routines such as random number generators, special functions [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The binaries for GSL 1.12 are provided in this post: </strong><a href="http://www.miscdebris.net/blog/2009/04/20/mingw-345-binaries-of-gnu-scientific-library-112-for-use-with-mingw-and-visual-c/"><strong>MinGW (3.4.5) binaries of GNU Scientific Library 1.12 for use with MinGW and Visual C++</strong></a></p>
<p>&#8220;The <a href="http://www.gnu.org/software/gsl/" target="_blank">GNU Scientific Library (GSL)</a> is a numerical library for C and C++ programmers. The library provides a wide range of mathematical routines such as random number generators, special functions and least-squares fitting. There are over 1000 functions in total with an extensive test suite&#8221;.</p>
<p>GSL is quite Unix centric but one might want to use the library at least with <a href="http://www.mingw.org/" target="_blank">MinGW</a> on Windows. I didn&#8217;t find any MinGW binaries of GSL apart from the <a href="http://ascendwiki.cheme.cmu.edu/Binary_installer_for_GSL-1.11_on_MinGW" target="_blank">one provided by the Ascend package</a> or the <a href="http://gnuwin32.sourceforge.net/packages/gsl.htm" target="_blank">binaries from GNUWin32</a> (which is only at version 1.8), but I don&#8217;t like graphical installers for libraries and I needed the static library. Therefore I compiled my own library with <a href="http://www.mingw.org/wiki/msys" target="_blank">MSYS</a> (I updated MSYS according to this link) and provide here the tarred binary package, which can also be used with the MinGW compiler without MSYS and with Visual C (import libraries for the shared library are provided).</p>
<p><span id="more-85"></span>There are no makefiles for the MinGW compiler but it is possible to compile the GSL in the MSYS development environment. I wrote a little bash script which downloads the GSL source package (with the help of <a title="curl for windows package" href="http://curl.haxx.se/download/curl-7.18.0-win32-nossl-sspi.zip">curl</a>), untars the package, compiles the source and assembles the binaries and necessary files for development in a tar.gz package using <a href="http://downloads.sourceforge.net/sevenzip/7za457.zip" target="_blank">7zip</a>. Curl and 7zip need to be in the path or in the same directory as the script. The script will create a gsl_mingw directory where the source package is downloaded to and all compilation steps will take place. The tar.gz package will be created in gsl_mingw/package and copied to the directory where the script was run. Below you can download the binary package of GSL 1.11 for the MinGW 3.4.5 compiler toolset (to be used in MSYS and in native Windows CLI) and the script I wrote to compile GSL in MSYS yourself if you want. I also added the import libraries for Visual C (only for the shared GSL) according <a href="http://gnuwin32.sourceforge.net/msimport.html" target="_blank">GNUWin32 descriptions</a>.</p>
<p>Download: <a href="http://www.miscdebris.net/upload/gsl-1.11_mingw-3.4.5.tar.gz" target="_self">GSL 1.11 Binary for MinGW 3.4.5</a> (with Visual C import libraries)</p>
<p>The script will create a directory &#8220;gsl_mingw&#8221; in the same directory where the script is run. Before the scripts starts downloading the GSL package, it shows some informations and waits for user input.</p>
<pre class="brush: jscript;">

#######################################################################
# This MSYS/bash batch file will download, compile and make a package
# of the GNU scientific library for the MinGW compiler. You need to
# have Msys and MinGW already installed.
#
# You need curl.exe and 7za.exe for this script to work
# correctly:
#   - curl 7.18.0 no SSL download location:
# http://curl.haxx.se/download/curl-7.18.0-win32-nossl-sspi.zip
#   - 7-zip 4.57 command line version:
# http://downloads.sourceforge.net/sevenzip/7za457.zip
#######################################################################

#######################################################################
# determine directories and set variables
# source package will be downloaded to $MAINDIR
# source will be compiled in $BUILDDIR
# binary package will be created in $ROOTDIR
#######################################################################
export GSL_VERSION=1.11
export GSL_URL=ftp://ftp.gnu.org/gnu/gsl/gsl-${GSL_VERSION}.tar.gz
export MINGW_VERSION=`gcc -dumpversion`

export ROOTDIR=`pwd`
export MAINDIR=$ROOTDIR/gsl_mingw
export BUILDDIR=$MAINDIR/gsl-${GSL_VERSION}
export PACKAGEDIR=$MAINDIR/package

#######################################################################
# show user the settings and ask if he wants to continue
#######################################################################
echo
echo ==============================================================
echo == Please check the settings
echo ==============================================================
echo
echo Directories
echo ===========
echo ROOTDIR=$ROOTDIR
echo MAINDIR=$MAINDIR
echo BUILDDIR=$BUILDDIR
echo PACKAGEDIR=$PACKAGEDIR
echo
echo Other
echo =====
echo GSL_URL=$GSL_URL
echo GSL_VERSION=$GSL_VERSION
echo MINGW_VERSION=$MINGW_VERSION
echo

echo &quot;Should the build process be continued? Type y to continue!&quot;
read -n 1 -s
if [ &quot;$REPLY&quot; != &quot;y&quot; ]; then
echo &quot;Shell script stopped ...&quot;
exit -1;
fi

#######################################################################
# create directories
#######################################################################
mkdir $MAINDIR
mkdir $PACKAGEDIR

#######################################################################
# download and unpack gsl source code
#######################################################################
echo +++ Downloading gsl from $GSL_URL +++
curl $GSL_URL -o $MAINDIR/gsl-${GSL_VERSION}.tar.gz
pushd $MAINDIR
tar xzf gsl-${GSL_VERSION}.tar.gz
popd

#######################################################################
# configure and build library
#######################################################################
mkdir $BUILDDIR/buildstatic
pushd $BUILDDIR/buildstatic
../configure --enable-static=yes --enable-shared=no --prefix=$PACKAGEDIR/gsl-${GSL_VERSION}-static
make
make install
popd

mkdir $BUILDDIR/buildshared
pushd $BUILDDIR/buildshared
# CFLAGS=-DGSL_DLL ../configure --enable-static=no --enable-shared=yes  --prefix=$PACKAGEDIR/gsl-${GSL_VERSION}
../configure --enable-static=no --enable-shared=yes --prefix=$PACKAGEDIR/gsl-${GSL_VERSION}-shared
make
make install
popd

#######################################################################
# make package for website
#######################################################################
if [ 1 == 1 ]
then
pushd $PACKAGEDIR
mkdir -p gsl-${GSL_VERSION}/lib-static
mkdir -p gsl-${GSL_VERSION}/lib-shared
mkdir -p gsl-${GSL_VERSION}/bin
mkdir -p gsl-${GSL_VERSION}/include

cp -r gsl-${GSL_VERSION}-static/include/* gsl-${GSL_VERSION}/include
cp -r gsl-${GSL_VERSION}-static/lib/* gsl-${GSL_VERSION}/lib-static
cp -r gsl-${GSL_VERSION}-shared/lib/* gsl-${GSL_VERSION}/lib-shared
cp -r gsl-${GSL_VERSION}-shared/bin/* gsl-${GSL_VERSION}/bin

echo 'This GNU Scientific Library DLL was generated using MingW/Msys.' &gt; gsl-${GSL_VERSION}/README.txt
echo 'configure settings:' &gt;&gt; gsl-${GSL_VERSION}/README.txt
echo '../configure --enable-static=yes --enable-shared=no' &gt;&gt; gsl-${GSL_VERSION}/README.txt
echo '../configure --enable-static=no --enable-shared=yes' &gt;&gt; gsl-${GSL_VERSION}/README.txt
echo '' &gt;&gt; gsl-${GSL_VERSION}/README.txt
echo 'To create Visual C import libraries open a VC command line' &gt;&gt; gsl-${GSL_VERSION}/README.txt
echo 'and in lib-shared run:' &gt;&gt; gsl-${GSL_VERSION}/README.txt
echo 'lib /machine:i386 /def:libgsl-0.def' &gt;&gt; gsl-${GSL_VERSION}/README.txt
echo 'lib /machine:i386 /def:libgslcblas-0.def' &gt;&gt; gsl-${GSL_VERSION}/README.txt
pushd gsl-${GSL_VERSION}/bin
strip gsl-histogram.exe gsl-randist.exe libgsl-0.dll libgslcblas-0.dll
pexports.exe libgsl-0.dll &gt; ../lib-shared/libgsl-0.def
pexports.exe libgslcblas-0.dll &gt; ../lib-shared/libgslcblas-0.def
popd
tar -cf gsl-${GSL_VERSION}_mingw-${MINGW_VERSION}.tar gsl-${GSL_VERSION}
gzip gsl-${GSL_VERSION}_mingw-${MINGW_VERSION}.tar
mv gsl-${GSL_VERSION}_mingw-${MINGW_VERSION}.tar.gz $ROOTDIR
popd
fi

exit 1
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.miscdebris.net/blog/2008/12/12/mingw-345-binaries-of-gnu-scientific-library-111/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
