[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gnucap] Compiling for FreeBSD
From: |
alan somers |
Subject: |
Re: [Help-gnucap] Compiling for FreeBSD |
Date: |
Sun, 2 Apr 2017 23:01:54 -0600 |
The gmake issue isn't too bad. Lots of software needs gmake when
built on FreeBSD. The bigger problem is that gnucap requires GCC.
FreeBSD's default compiler is Clang, and GCC is a huge dependency to
bring in. It would be great if Gnucap would compile with Clang. The
following patch gets Gnucap to compile, but not link., with Clang. I
get link errors like this:
(export LD_LIBRARY_PATH=`pwd | sed 's/apps/lib/g'`; `pwd | sed
's/apps/modelgen/g'`/gnucap-modelgen -cc ../d_mos1.model)
@@#
@@@unreachable:../../include/l_dispatcher.h:81:install
build error: link order: dispatcher not yet constructed
diff --git a/apps/configure b/apps/configure
index fce17a9..1fbb987 100755
--- a/apps/configure
+++ b/apps/configure
@@ -35,7 +35,7 @@ echo "" >>Make.libs
cat <<CAT_EOF >Make.sys
#------------------------------------------------------------------------
VPATH = .:..
-CCC = g++
+CCC = c++
TARGET_EXT = .so
LDFLAGS = -shared
diff --git a/include/configure b/include/configure
index 31dea5e..912b8ab 100755
--- a/include/configure
+++ b/include/configure
@@ -22,7 +22,7 @@ fi
#----------------------------------------------------------------
echo \# created by $PWD/$0. do not edit >Make2
echo \#------------------------------------------------------------------------
>>Make2
-echo "CCC = g++" >>Make2
+echo "CCC = c++" >>Make2
echo "PREFIX = " $prefix >>Make2
echo "" >>Make2
diff --git a/lib/c_attach.cc b/lib/c_attach.cc
index ac57a12..fe968e7 100644
--- a/lib/c_attach.cc
+++ b/lib/c_attach.cc
@@ -107,7 +107,7 @@ public:
void do_it(CS& cmd, CARD_LIST*)
{
if (CARD_LIST::card_list.is_empty()) {
- for (std::map<std::string, void*>::iterator
+ for (std::map<const std::string, void*>::iterator
ii = attach_list.begin(); ii != attach_list.end(); ++ii) {
void* handle = ii->second;
if (handle) {
diff --git a/lib/configure b/lib/configure
index b027a5f..f4c68ce 100755
--- a/lib/configure
+++ b/lib/configure
@@ -28,7 +28,7 @@ echo "CCFLAGS = -fPIC \\" >Make.ccflags
echo "LIBS = -ldl \\" >Make.libs
rm -f a.out
-g++ -lreadline -ltermcap test_readline.cc
+c++ -lreadline -ltermcap test_readline.cc
if [ -f a.out ] ; then
echo "using readline"
echo "-DHAVE_LIBREADLINE \\" >>Make.ccflags
@@ -46,7 +46,7 @@ echo "" >>Make.libs
cat <<CAT_EOF >Make.sys
#------------------------------------------------------------------------
VPATH = .:..
-CCC = g++
+CCC = c++
TARGET_EXT = .so
LDFLAGS = -shared
diff --git a/main/configure b/main/configure
index b56e2cc..d11d07e 100755
--- a/main/configure
+++ b/main/configure
@@ -36,7 +36,7 @@ echo "" >>Make.libs
cat <<CAT_EOF >Make.sys
#------------------------------------------------------------------------
VPATH = .:..
-CCC = g++
+CCC = c++
TARGET_EXT =
LDFLAGS = -rdynamic \
diff --git a/modelgen/configure b/modelgen/configure
index b56e2cc..d11d07e 100755
--- a/modelgen/configure
+++ b/modelgen/configure
@@ -36,7 +36,7 @@ echo "" >>Make.libs
cat <<CAT_EOF >Make.sys
#------------------------------------------------------------------------
VPATH = .:..
-CCC = g++
+CCC = c++
TARGET_EXT =
LDFLAGS = -rdynamic \
On Sun, Apr 2, 2017 at 9:46 PM, al davis <address@hidden> wrote:
> On Fri, 31 Mar 2017 22:08:26 +1100
> Richard Gipps <address@hidden> wrote:
>> 1. FreeBSD uses PMake rather than GNU Make. Part of the compilation
>> fails with PMake. To change to GNU Make perform the following steps:
>> a) Download and install GNU Make: pkg install gmake-4.2.1_1.
>> b) cd /usr/bin
>> c) mv make make.backup (in case you need to change back)
>> d) create a symbolic link: ln -s /usr/local/bin/gmake make
>
> How about:
> a) install make (pkg install gmake)
> b) type "gmake" instead of "make"
>
> If you have a fix for it that will make it work with pmake, I would
> likely apply the fix. (provided that it is simple, clean, and doesn't
> break gmake).
>
>
>> 1. Add the following line to gnucap\lib\test_readline.cc
>>
>> #include <stdio.h>
>>
>> I am note sure how the configure script could work on any system
>> without this change as readline.h references a FILE* but does not
>> include stdio.
>
> Obviously it did work for me. I would not have released it otherwise.
>
> Doing a little research here ..... The Debian version includes
> stdio.h, since 2001. Apparently the change was never applied back to
> "upstream", because the git master does not.
>
> Header files are supposed to include what they need, so this is really
> a bug in readline.
>
> But since that's the way it is, I have changed it in gnucap, with a
> comment stating that it may be needed by readline.h and history.h.
> Without the comment, it will disappear again as apparently useless code
> is removed.
>
> It's really not critical, because it doesn't prevent you from building
> gnucap. It just builds it without readline.
>
>> 2. run the configure script.
>>
>> 3. In gnucap/lib/Make2 change -ldl to -lc as on FreeBSD, libdl is part
>> of libc.
>
> make the change to gnucap/lib/configure, which generates
> gnucap/lib/Make2 .
>
> Do that for now. We need to further study what is going on to make a
> proper fix. The "dlopen" and family seems to be inconsistent between
> systems.
>
>
>> 4. run make
- Re: [Help-gnucap] Compiling for FreeBSD, al davis, 2017/04/02
- Re: [Help-gnucap] Compiling for FreeBSD,
alan somers <=
- Re: [Help-gnucap] Compiling for FreeBSD, al davis, 2017/04/03
- Re: [Help-gnucap] Compiling for FreeBSD, alan somers, 2017/04/03
- Re: [Help-gnucap] Compiling for FreeBSD, al davis, 2017/04/04
- Re: [Help-gnucap] Compiling for FreeBSD, alan somers, 2017/04/04
- Re: [Help-gnucap] Compiling for FreeBSD, al davis, 2017/04/05
- Re: [Help-gnucap] [Gnucap-devel] Compiling for FreeBSD, al davis, 2017/04/05
- Re: [Help-gnucap] [Gnucap-devel] Compiling for FreeBSD, alan somers, 2017/04/05