Jump to content

Recommended Posts

Hi all!

I have a problem adding SCV library. I am new to SystemC! I am using 64bit Windows 7 and I have installed Cygwin x86_64. SystemC works with Eclipse but I am unable to add SCV library. When I try to execute

$ ../configure --with-systemc=/cygwin/c/systemc-2.3.1 

it writes out numerous lines and then I get errors

checking for supported C++ compiler... configure: WARNING: gcc 5.4 is not a supported version (i.e. (3.2|3.4|4.1|4.2|4.3|4.4|4.5|4.6|4.7|4.8)).  Beware.
checking for supported operating system... configure: error: cygwin is not supported

Is there any way to get around this problem?

 

Link to comment
Share on other sites

Should I change configure.ac or configure file? I tried changing the configure.ac file and it made no difference. Changing configure file made this errors

../configure: line 14: $'\r': command not found
../configure: line 29: syntax error near unexpected token `newline'
'./configure: line 29: `     ;;

even after changing everything back. Only copying old file instead of the changed one would make the error go away.

Link to comment
Share on other sites

my reply probably got lost. Anyway, I managed to rename folder containing libsystemc.a from lib-cygwin64 to lib-cygwin and it successfully finished configure. Make and make install have these errors

../../../src/scv/scv_init_seed.cpp: In function 'long long unsigned int _scv_default_global_init_seed(long unsigned int)':
../../../src/scv/scv_init_seed.cpp:76:19: error: aggregate '_scv_default_global_init_seed(long unsigned int)::timezone dummy1' has incomplete type and cannot be defined
   struct timezone dummy1;
                   ^
../../../src/scv/scv_init_seed.cpp:77:28: error: 'gettimeofday' was not declared in this scope
   gettimeofday(&tp, &dummy1);
                            ^
make[2]: *** [Makefile:542: libscv_la-scv_init_seed.lo] Error 1
make[2]: Leaving directory '/cygdrive/c/scv-2.0.0/objdir/src/scv'
make[1]: *** [Makefile:440: check-recursive] Error 1
make[1]: Leaving directory '/cygdrive/c/scv-2.0.0/objdir/src'
make: *** [Makefile:484: check-recursive] Error 1

Will this work anyway?

Link to comment
Share on other sites

Firstly, thanks for all the help. I have followed SystemC-2.3.1 INSTALL manual and done everything it said. Then I downloaded scv-2.0.0 and somehow called

$ configure

 and it showed no errors. Then i called

$ make 

and it showed a ton of text and in the end showed errors i copied two posts before.

I called 

$ make install

and it also wrote out a ton of text and printed the same two errors.

I am a bit stuck here. I need to use SCV in Eclipse but i cannot include <scv.h>. Eclipse doesn't see the scv.h file.

Link to comment
Share on other sites

I was finally able to call $ make without it getting any errors. There is an error in scv-2.0.0\src\scv\scv_init_seed.cpp: it should include sys\time.h instead of time.h because struct timezone that could not be found is defined in sys\time.h. Now $ make went trough without errors and $ make install and $ make check showed no errors.

 

How can I connect this library to be used in Eclipse?

Link to comment
Share on other sites

I did it!

 

If anyone else needs it:

there should be libscv.a and libscv.la in lib-cygwin folder in systemc folder after installation of scv library. So just go to the project you are working on in Eclipse -> Properties -> C/C++ Build -> Settings -> Cygwin C++ Linker and add scv to the libraries list!

 

Thank you, Stephan, for all the help! 

Link to comment
Share on other sites

  • 5 years later...

Hi 🙂

Pretty old topic, but i've found that when trying to build SCV using GCC with MSYS2 on Windows machine i got error that gettimeofday is not defined:

make[2]: Entering directory '/f/libs/repos/_1_downloaded_/scv-2.0.1/objdir-msys/src/scv'
/bin/sh ../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../src/scv -I../../config  -I../../src -I../../../src -I../../../src/cudd/2.3.0/cudd -I../../../src/cudd/2.3.0/obj -I../../../src/cudd/2.3.0/util -I../../../src/cudd/2.3.0/mtr -I../../../src/cudd/2.3.0/st -I/f/libs/systemc-2.3.3/include  -Wall -Wformat -O2 -D__MSVCRT_VERSION__=0x601 -O0 -g -D__MSVCRT_VERSION__=0x601 -MT libscv_la-scv_init_seed.lo -MD -MP -MF .deps/libscv_la-scv_init_seed.Tpo -c -o libscv_la-scv_init_seed.lo `test -f 'scv_init_seed.cpp' || echo '../../../src/scv/'`scv_init_seed.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../src/scv -I../../config -I../../src -I../../../src -I../../../src/cudd/2.3.0/cudd -I../../../src/cudd/2.3.0/obj -I../../../src/cudd/2.3.0/util -I../../../src/cudd/2.3.0/mtr -I../../../src/cudd/2.3.0/st -I/f/libs/systemc-2.3.3/include -Wall -Wformat -O2 -D__MSVCRT_VERSION__=0x601 -O0 -g -D__MSVCRT_VERSION__=0x601 -MT libscv_la-scv_init_seed.lo -MD -MP -MF .deps/libscv_la-scv_init_seed.Tpo -c ../../../src/scv/scv_init_seed.cpp -o libscv_la-scv_init_seed.o
../../../src/scv/scv_init_seed.cpp: In function 'long long unsigned int _scv_default_global_init_seed(long unsigned int)':
../../../src/scv/scv_init_seed.cpp:84:19: error: aggregate '_scv_default_global_init_seed(long unsigned int)::timezone dummy1' has incomplete type and cannot be defined
   84 |   struct timezone dummy1;
      |                   ^~~~~~
../../../src/scv/scv_init_seed.cpp:85:3: error: 'gettimeofday' was not declared in this scope
   85 |   gettimeofday(&tp, &dummy1);
      |   ^~~~~~~~~~~~
make[2]: *** [Makefile:542: libscv_la-scv_init_seed.lo] Error 1
make[2]: Leaving directory '/f/libs/repos/_1_downloaded_/scv-2.0.1/objdir-msys/src/scv'
make[1]: *** [Makefile:440: all-recursive] Error 1
make[1]: Leaving directory '/f/libs/repos/_1_downloaded_/scv-2.0.1/objdir-msys/src'
make: *** [Makefile:484: all-recursive] Error 1

I've followed StackOverflow link provided by Stephan - and then i've spent some time just to notice, that there is lack of #include file of sys/time.h (not sys/times.h, that is already present in scv_init_seed.cpp).

For MSYS GCC some interesting initial #defines (i was curious how to make some fix not only for MSYS, but also for Cygwin, which i also use from time to time) - launching:

 g++ -dM -E - < /dev/null | grep -iE "cygwin|win|msys|win"

gave result - for MSYS:

#define __WINT_MAX__ 0xffffffffU
#define __WINT_MIN__ 0U
#define __MSYS__ 1
#define __SIZEOF_WINT_T__ 4
#define __CYGWIN__ 1
#define __WINT_TYPE__ unsigned int
#define __WINT_WIDTH__ 32

and for CYGWIN:

#define __WINT_MAX__ 0xffffffffU
#define __WINT_MIN__ 0U
#define __SIZEOF_WINT_T__ 4
#define __CYGWIN__ 1
#define __WINT_TYPE__ unsigned int
#define __WINT_WIDTH__ 32

Suprisingly, MSYS also #defines __CYGWIN__ (as Cygwin does) together with __MSYS__.

As a fix i've added at very beginning of scv_init_seed.cpp:

#if (defined __CYGWIN__) || (defined __MSYS__)
#  include <sys/time.h>
#endif

Additional check for __MSYS__ seems to be a bit redundant, but left for clarity.

As for now - SCV can be build with MSYS GCC 🙂

Regards !

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...