tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkgsrc/lang/g95 and NetBSD/amd64 current with gcc 4.8.3



Hi,

From: Ryo ONODERA <ryo_on%yk.rim.or.jp@localhost>, Date: Sat, 05 Apr 2014 
12:38:20 +0900 (JST)

> Hi,
> 
> Can anyone who use NetBSD/amd64 current with gcc 4.8.3 build
> pkgsrc/lang/g95 successfully?
> I have following errors.
> 
> checking whether we are using the GNU C compiler... yes
> checking whether /usr/tmp/pkgsrc/lang/g95/work/gcc-4.1.2/g95/./gcc/xgcc 
> -B/usr/tmp/pkgsrc/lang/g95/work/gcc-4.1.2/g95/./gcc/ 
> -B/usr/pkg/x86_64--netbsd/bin/ -B/usr/pkg/x86_64--netbsd/lib/ -isystem 
> /usr/pkg/x86_64--netbsd/include -isystem /usr/pkg/x86_64--netbsd/sys-include 
> accepts -g... yes
> checking for /usr/tmp/pkgsrc/lang/g95/work/gcc-4.1.2/g95/./gcc/xgcc 
> -B/usr/tmp/pkgsrc/lang/g95/work/gcc-4.1.2/g95/./gcc/ 
> -B/usr/pkg/x86_64--netbsd/bin/ -B/usr/pkg/x86_64--netbsd/lib/ -isystem 
> /usr/pkg/x86_64--netbsd/include -isystem /usr/pkg/x86_64--netbsd/sys-include 
> option to accept ANSI C... none needed
> checking for style of include used by /usr/pkg/bin/gmake... GNU
> checking dependency style of 
> /usr/tmp/pkgsrc/lang/g95/work/gcc-4.1.2/g95/./gcc/xgcc 
> -B/usr/tmp/pkgsrc/lang/g95/work/gcc-4.1.2/g95/./gcc/ 
> -B/usr/pkg/x86_64--netbsd/bin/ -B/usr/pkg/x86_64--netbsd/lib/ -isystem 
> /usr/pkg/x86_64--netbsd/include -isystem 
> /usr/pkg/x86_64--netbsd/sys-include... gcc3
> checking how to run the C preprocessor... cpp
> configure: error: C preprocessor "cpp" fails sanity check
> See `config.log' for more details.
> Makefile:7755: recipe for target 'configure-target-libssp' failed
> gmake[1]: *** [configure-target-libssp] Error 1
> gmake[1]: Leaving directory '/usr/tmp/pkgsrc/lang/g95/work/gcc-4.1.2/g95'
> Makefile:614: recipe for target 'all' failed
> gmake: *** [all] Error 2
> *** Error code 2
> 
> Stop.
> make[1]: stopped in /usr/pkgsrc/lang/g95
> WARNING: Please add USE_TOOLS+=perl to the package Makefile.
> *** Error code 1
> 
> Stop.
> make: stopped in /usr/pkgsrc/lang/g95
> 
> 
> From: work/gcc-4.1.2/g95/x86_64--netbsd/libssp/config.log
> 
> configure:3247: cpp  conftest.c
> /usr/tmp/pkgsrc/lang/g95/work/gcc-4.1.2/g95/./gcc/libgcc_s.so.1: version 
> GCC_4.2.0 required by /usr/lib/libstdc++.so.7 not found
> configure:3253: $? = 1
> configure: failed program was:
> | /* confdefs.h.  */
> |
> | #define PACKAGE_NAME "libssp"
> | #define PACKAGE_TARNAME "libssp"
> | #define PACKAGE_VERSION "1.0"
> | #define PACKAGE_STRING "libssp 1.0"
> | #define PACKAGE_BUGREPORT ""
> | #define PACKAGE "libssp"
> | #define VERSION "1.0"
> | /* end confdefs.h.  */
> | #ifdef __STDC__
> | # include <limits.h>
> | #else
> | # include <assert.h>
> | #endif
> |                    Syntax error
> configure:3321: error: C preprocessor "cpp" fails sanity check
> See `config.log' for more details.

I have created gfortran package (based on gcc48; not attached)
and its support files (based on g95 support code; attached).
It works under NetBSD/amd64 6.99.28 (gcc 4.5.4) and 6.99.39 (gcc 4.8.3)
in the following cases.

(1) GCC_READ+=4.8
(2) PKGSRC_FORTRAN=gfortran
(3) GCC_READ+=4.8 and PKGSRC_FORTRAN=gfortran

I will commit gfortran package and gfortran support code.

If someone cannot build lang/g95 under NetBSD/amd64 6.99.39 with gcc 4.8.3,
I would like to change default Fortran compiler to gfortran
for NetBSD/amd64 6.99.38 or later (in gcc 4.8 case only).

Thank you.


Index: compiler/gcc.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/compiler/gcc.mk,v
retrieving revision 1.144
diff -u -r1.144 gcc.mk
--- compiler/gcc.mk     4 Feb 2014 12:11:57 -0000       1.144
+++ compiler/gcc.mk     5 Apr 2014 23:43:33 -0000
@@ -834,7 +834,13 @@
 # The default is g95 as it supports a modern dialect, but it can
 # be overridden in mk.conf to use only f2c.
 #
+.if (!empty(MACHINE_PLATFORM:MNetBSD-6.99.3[8-9]-*) || \
+       !empty(MACHINE_PLATFORM:MNetBSD-6.99.[4-9]*-*)) && \
+       !empty(CC_VERSION:Mgcc-4.8*)
+PKGSRC_FORTRAN?=gfortran
+.else
 PKGSRC_FORTRAN?=g95
+.endif
 
 _GCC_NEEDS_A_FORTRAN=  no
 .if empty(_USE_PKGSRC_GCC:M[yY][eE][sS]) && !exists(${FCPATH})
Index: compiler/gfortran.mk
===================================================================
RCS file: compiler/gfortran.mk
diff -N compiler/gfortran.mk
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ compiler/gfortran.mk        5 Apr 2014 23:43:33 -0000
@@ -0,0 +1,117 @@
+# $NetBSD: g95.mk,v 1.4 2012/12/15 21:23:31 markd Exp $
+#
+# Copyright (c) 2005 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Johnny C. Lam.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. All advertising materials mentioning features or use of this software
+#    must display the following acknowledgement:
+#        This product includes software developed by the NetBSD
+#        Foundation, Inc. and its contributors.
+# 4. Neither the name of The NetBSD Foundation nor the names of its
+#    contributors may be used to endorse or promote products derived
+#    from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+.if !defined(COMPILER_GFORTRAN_MK)
+COMPILER_G95_MK=       defined
+
+.include "../../mk/bsd.prefs.mk"
+
+.if !empty(PKGPATH:Mlang/gfortran) || !empty(PKGPATH:Mdevel/patch) || \
+    !empty(PKGPATH:Mdevel/libtool-base)
+IGNORE_GFORTRAN=       yes
+MAKEFLAGS+=            IGNORE_GFORTRAN=yes
+.endif
+
+.if defined(IGNORE_GFORTRAN)
+_USE_GFORTRAN= NO
+.endif
+
+# LANGUAGES.<compiler> is the list of supported languages by the compiler.
+# _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the ones
+# requested by the package in USE_LANGUAGES.
+#
+LANGUAGES.gfortran=    fortran fortran77
+_LANGUAGES.gfortran=   # empty
+.for _lang_ in ${USE_LANGUAGES}
+_LANGUAGES.gfortran+=  ${LANGUAGES.gfortran:M${_lang_}}
+.endfor
+.if empty(_LANGUAGES.gfortran)
+_USE_GFORTRAN= NO
+.endif
+
+.if !defined(_USE_GFORTRAN)
+_USE_GFORTRAN= YES
+.endif
+
+.if !empty(_USE_GFORTRAN:M[yY][eE][sS])
+EVAL_PREFIX+=          _GFORTRANBASE=gfortran
+_G95BASE_DEFAULT=      ${LOCALBASE}
+FC=            gfortran
+
+_GFORTRAN_DIR= ${WRKDIR}/.gfortran
+_GFORTRAN_VARS=        # empty
+.  if !empty(_LANGUAGES.gfortran:Mfortran) || \
+      !empty(_LANGUAGES.gfortran:Mfortran77)
+PKG_FC?=       ${FC}
+_GFORTRAN_VARS+=       FC
+_GFORTRAN_FC:= ${_GFORTRAN_DIR}/bin/${PKG_FC:T}
+_ALIASES.FC+=  f77 g77 g95 gfortran
+FCPATH=                ${_GFORTRANBASE}/bin/gfortran
+PKG_FC:=       ${_GFORTRAN_FC}
+.  endif
+
+# Prepend the path the to the compiler to the PATH
+.  if !empty(_LANGUAGES.gfortran)
+PREPEND_PATH+= ${_GFORTRAN_DIR}/bin
+.  endif
+
+# Add the dependency on gfortran.
+.  include "../../lang/gfortran/buildlink3.mk"
+
+.  if defined(GFORTRAN_DIR) && !empty(GFORTRAN_DIR)
+PKGSRC_MAKE_ENV+=      GFORTRAN_DIR=${GFORTRAN_DIR:Q}
+.  endif
+
+# Create symlinks for the compiler into ${WRKDIR}.
+.  for _var_ in ${_GFORTRAN_VARS}
+.    if !target(${_GFORTRAN_${_var_}})
+override-tools: ${_GFORTRAN_${_var_}}
+${_GFORTRAN_${_var_}}:
+       ${RUN}${MKDIR} ${.TARGET:H}
+       ${RUN}                                  \
+       ${LN} -fs ${_GFORTRANBASE}/bin/gfortran ${.TARGET}
+.      for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//}
+       ${RUN}                                  \
+       if [ ! -x "${_alias_}" ]; then                                  \
+               ${LN} -fs ${_GFORTRANBASE}/bin/gfortran ${_alias_};             
\
+       fi
+.      endfor
+.    endif
+.  endfor
+.endif # _USE_GFORTRAN == "yes"
+
+.endif # COMPILER_GFORTRAN_MK

--
Ryo ONODERA // ryo_on%yk.rim.or.jp@localhost
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


Home | Main Index | Thread Index | Old Index