You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by Petrus Hyvönen <pe...@gmail.com> on 2011/07/04 23:15:09 UTC

Problems building JCC

Hi,

This is likely another faq but,

I've moved to a windows 7 machine (64bit) and trying to compile jcc. mingw32
compiler, JDK, JRE installed. I'm getting a libjcc.a - No such file or
directory error. javac is available at the command prompt.

Building with:

python setup.py build --compiler=mingw32

Any help highly appriciated.
/Petrus


writing build\temp.win32-2.6\Release\jcc\sources\jcc.def
C:\Program Files (x86)\pythonxy\mingw\bin\g++.exe -mno-cygwin -mdll -static
--en
try _DllMain@12 -Wl,--out-implib,build\lib.win32-2.6\jcc\jcc.lib
--output-lib bu
ild\temp.win32-2.6\Release\jcc\sources\libjcc.a --def
build\temp.win32-2.6\Relea
se\jcc\sources\jcc.def -s build\temp.win32-2.6\Release\jcc\sources\jcc.o
build\t
emp.win32-2.6\Release\jcc\sources\jccenv.o -LC:\Python26\libs
-LC:\Python26\PCbu
ild -lpython26 -lmsvcr90 -o build\lib.win32-2.6\jcc.dll "-LC:\Program Files
(x86
)\Java\jdk1.6.0_26/lib" -ljvm -Wl,-S -Wl,--out-implib,jcc\jcc.lib
g++: build\temp.win32-2.6\Release\jcc\sources\libjcc.a: No such file or
director
y
error: command 'g++' failed with exit status 1

Re: Problems building JCC

Posted by Andi Vajda <va...@apache.org>.
 Hi Petrus,

On Jul 4, 2011, at 23:15, Petrus Hyvönen <pe...@gmail.com> wrote:

> This is likely another faq but,
> 
> I've moved to a windows 7 machine (64bit) and trying to compile jcc. mingw32
> compiler, JDK, JRE installed. I'm getting a libjcc.a - No such file or
> directory error. javac is available at the command prompt.

I don't use this compiler so I don't have an answer. Maybe someone else on this list ?
In any case, if you solve the problem, please post the solution so that the next 64-bit mingw user facing this can find it here. 

Thanks !

Andi.,

> 
> Building with:
> 
> python setup.py build --compiler=mingw32
> 
> Any help highly appriciated.
> /Petrus
> 
> 
> writing build\temp.win32-2.6\Release\jcc\sources\jcc.def
> C:\Program Files (x86)\pythonxy\mingw\bin\g++.exe -mno-cygwin -mdll -static
> --en
> try _DllMain@12 -Wl,--out-implib,build\lib.win32-2.6\jcc\jcc.lib
> --output-lib bu
> ild\temp.win32-2.6\Release\jcc\sources\libjcc.a --def
> build\temp.win32-2.6\Relea
> se\jcc\sources\jcc.def -s build\temp.win32-2.6\Release\jcc\sources\jcc.o
> build\t
> emp.win32-2.6\Release\jcc\sources\jccenv.o -LC:\Python26\libs
> -LC:\Python26\PCbu
> ild -lpython26 -lmsvcr90 -o build\lib.win32-2.6\jcc.dll "-LC:\Program Files
> (x86
> )\Java\jdk1.6.0_26/lib" -ljvm -Wl,-S -Wl,--out-implib,jcc\jcc.lib
> g++: build\temp.win32-2.6\Release\jcc\sources\libjcc.a: No such file or
> director
> y
> error: command 'g++' failed with exit status 1

Re: Problems building JCC

Posted by Bill Janssen <ja...@parc.com>.
Petrus,

> g++: build\temp.win32-2.6\Release\jcc\sources\libjcc.a: No such file or
> director
> y

If you could find a mail tool which doesn't wrap the lines of the log
you're trying to send, that would help to debug this.  But it looks to
me as if something is not creating that directory before trying to
write into it.

I build regularly on Win XP with mingw.  I have a Win7 machine; I'll try
to build on it this afternoon, and let you know what I see.  I attach my
build script; this is a piece of a larger /bin/sh script.  I believe I've
used it successfully on Win7, too.

The missing piece might be my jcc-2.9-mingw-PATCH; I include a copy of
it below, as well.  But it looks to me as if Andi has already merged it
into the sources.

Bill

echo "-- jcc --"
export PATH="$PATH:${javahome}/jre/bin/client"
echo "PATH is $PATH"
cd ../pylucene-3.0.*/jcc
# note that this patch still works for 3.0.1/3.0.2
patch -p0 < ${patchesdir}/jcc-2.9-mingw-PATCH
export JCC_ARGSEP=";"
export JCC_JDK="$WINSTYLEJAVAHOME"
export JCC_CFLAGS="-fno-strict-aliasing;-Wno-write-strings"
export JCC_LFLAGS="-L${WINSTYLEJAVAHOME}\\lib;-ljvm"
export JCC_INCLUDES="${WINSTYLEJAVAHOME}\\include;${WINSTYLEJAVAHOME}\\include\\win32"
export JCC_JAVAC="${WINSTYLEJAVAHOME}\\bin\\javac.exe"
${python} setup.py build --compiler=mingw32 install --single-version-externally-managed --root /c/ --prefix="${distdir}"
if [ -f jcc/jcc.lib ]; then
  cp -p jcc/jcc.lib "${sitepackages}/jcc/jcc.lib"
fi
# for 3.0.2 compiled with MinGW GCC 4.x and "--shared", we also need two
# GCC libraries
if [ -f /mingw/bin/libstdc++-6.dll ]; then
  install -m 555 /mingw/bin/libstdc++-6.dll "${distdir}/bin/"
  echo "copied libstdc++-6.dll"
fi
if [ -f /mingw/bin/libgcc_s_dw2-1.dll ]; then
  install -m 555 /mingw/bin/libgcc_s_dw2-1.dll "${distdir}/bin/"
  echo "copied libgcc_s_dw2-1.dll"
fi
cd ..


--- jcc-2.9-mingw-PATCH

*** setup.py	2009-10-28 15:24:16.000000000 -0700
--- setup.py	2010-03-29 22:08:56.000000000 -0700
***************
*** 262,268 ****
          elif platform == 'win32':
              jcclib = 'jcc%s.lib' %(debug and '_d' or '')
              kwds["extra_link_args"] = \
!                 lflags + ["/IMPLIB:%s" %(os.path.join('jcc', jcclib))]
              package_data.append(jcclib)
          else:
              kwds["extra_link_args"] = lflags
--- 262,268 ----
          elif platform == 'win32':
              jcclib = 'jcc%s.lib' %(debug and '_d' or '')
              kwds["extra_link_args"] = \
!                 lflags + ["-Wl,--out-implib,%s" %(os.path.join('jcc', jcclib))]
              package_data.append(jcclib)
          else:
              kwds["extra_link_args"] = lflags