[Disksim-users] FW: sqrt problem during make

Payne, Benjamin bpayne at lps.umd.edu
Wed Nov 7 08:59:58 EST 2012


Thanks for the fix Peter.

If this is all known, what is the route for getting the source code fixed?

Kindly,


Ben

-----Original Message-----
From: Peter Macko [mailto:pmacko at eecs.harvard.edu]
Sent: Wednesday, November 07, 2012 8:56 AM
To: Payne, Benjamin
Cc: disksim-users at ece.cmu.edu
Subject: Re: [Disksim-users] FW: sqrt problem during make

I haven't used disksim in more than a year (so I am not an active user by any means), but your email prompted me to do some research about how I solved this.

In memsmodel/Makefile, just change:

mems_seektest: mems_seektest.o libmems_internals.a
         $(CC) -o $@ mems_seektest.o $(LDFLAGS) $(CFLAGS) -lmems_internals

to:

mems_seektest: mems_seektest.o libmems_internals.a
         $(CC) -o $@ mems_seektest.o $(CFLAGS) -lmems_internals $(LDFLAGS)

This should hopefully fix the sqrt problem. (I am not sure if that's all you need, but see if this helps.)

The duplicate case value is a result of a static assertion that checks to make sure that you are running on a 32-bit system. For 64-bit systems, you can get a patch from here:
http://scobyseo.blogspot.com/2009/12/disksim-40-ssd-extention-64bit-patch.html
The patch did not apply cleanly for me, so I had to apply it manually, and then it worked (plus you should feel free to ignore the ssdmodel part if you are not using the SSD extensions).

Best,
-Peter


On 11/07/2012 08:38 AM, Payne, Benjamin wrote:
> Hello,
>
> Komal Shah's screenshot is of the same problem I mentioned below and never received a reply on.
>
> The purpose of this email is to see if there are any developers or other active people reading this list: Are you here?
>
> Thanks,
>
> Ben
>
> -----Original Message-----
> From: disksim-users-bounces at ece.cmu.edu
> [mailto:disksim-users-bounces at ece.cmu.edu] On Behalf Of Payne,
> Benjamin
> Sent: Friday, November 02, 2012 12:37 PM
> To: disksim-users at ece.cmu.edu
> Subject: [Disksim-users] sqrt problem during make
>
> Hello,
>
> >From reading the list archives, I see the problem with sqrt being undefined during installation isn't new:
> https://sos.ece.cmu.edu/pipermail/disksim-users/2011-December/000699.h
> tml
> http://cboard.cprogramming.com/c-programming/144182-gcc-compile-proble
> m-link.html
>
> The details are below, but my question is on fixing this. Did I make a mistake during installation, or is this normal? If the error is normal, how can it be fixed?
>
> On a fresh installation of Ubuntu 12.04 64bit, I ran the following commands to get started with disksim:
>
> sudo apt-get install flex bison
> wget http://www.pdl.cmu.edu/PDL-FTP/DriveChar/disksim-4.0.tar.gz
> tar xzf disksim-4.0.tar.gz
> cd disksim-4.0
> make
>
> The output from "make" is
>
> bpayne at bpayne-VirtualBox64:~/disksim-4.0$ make make -C libddbg
> make[1]: Entering directory `/home/bpayne/disksim-4.0/libddbg'
> mkdir -p include/libddbg lib
> cp -p libddbg.h include/libddbg
> cp -p libddbg.a lib
> make[1]: Leaving directory `/home/bpayne/disksim-4.0/libddbg'
> make -C libparam
> make[1]: Entering directory `/home/bpayne/disksim-4.0/libparam'
> mkdir -p lib include/libparam
> cp -p libparam.a lib
> cp -p bitvector.h libparam.h include/libparam
> make[1]: Leaving directory `/home/bpayne/disksim-4.0/libparam'
> make -C diskmodel
> make[1]: Entering directory `/home/bpayne/disksim-4.0/diskmodel'
> make -C tests
> make[2]: Entering directory `/home/bpayne/disksim-4.0/diskmodel/tests'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `/home/bpayne/disksim-4.0/diskmodel/tests'
> make[1]: Leaving directory `/home/bpayne/disksim-4.0/diskmodel'
> make -C memsmodel
> make[1]: Entering directory `/home/bpayne/disksim-4.0/memsmodel'
> gcc -Wall -Wno-unused -MD -o mems_seektest mems_seektest.o -lm -L. -g
> -DASSERTS  -I../src// -I../ -I../src//src -lmems_internals
> ./libmems_internals.a(mems_piecewise_seek.o): In function `find_seek_time_piecewise':
> /home/bpayne/disksim-4.0/memsmodel/mems_piecewise_seek.c:523: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_piecewise_seek.c:565: undefined reference to `sqrt'
> ./libmems_internals.a(mems_hong_seek.o): In function `find_seek_time_hong_x':
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:78: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:80: undefined reference to `acos'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:94: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:96: undefined reference to `acos'
> ./libmems_internals.a(mems_hong_seek.o): In function `find_seek_time_hong_y':
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:174: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:182: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:182: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:179: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:176: undefined reference to `asin'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:194: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:202: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:202: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:199: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:196: undefined reference to `asin'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:214: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:222: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:222: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:219: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:216: undefined reference to `asin'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:265: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:273: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:273: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:270: undefined reference to `sqrt'
> /home/bpayne/disksim-4.0/memsmodel/mems_hong_seek.c:267: undefined reference to `asin'
> collect2: ld returned 1 exit status
> make[1]: *** [mems_seektest] Error 1
> make[1]: Leaving directory `/home/bpayne/disksim-4.0/memsmodel'
> make: *** [all] Error 2
>
> However, by running the following
>
> cd memsmodel
> gcc -Wall -Wno-unused -MD -o mems_seektest mems_seektest.o -lm -L. -g -DASSERTS  -I../src// -I../ -I../src//src -lmems_internals -lm cd ..
>
> and then trying make again, I get new output:
>
> bpayne at bpayne-VirtualBox64:~/disksim-4.0$ make make -C libddbg
> make[1]: Entering directory `/home/bpayne/disksim-4.0/libddbg'
> mkdir -p include/libddbg lib
> cp -p libddbg.h include/libddbg
> cp -p libddbg.a lib
> make[1]: Leaving directory `/home/bpayne/disksim-4.0/libddbg'
> make -C libparam
> make[1]: Entering directory `/home/bpayne/disksim-4.0/libparam'
> mkdir -p lib include/libparam
> cp -p libparam.a lib
> cp -p bitvector.h libparam.h include/libparam
> make[1]: Leaving directory `/home/bpayne/disksim-4.0/libparam'
> make -C diskmodel
> make[1]: Entering directory `/home/bpayne/disksim-4.0/diskmodel'
> make -C tests
> make[2]: Entering directory `/home/bpayne/disksim-4.0/diskmodel/tests'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `/home/bpayne/disksim-4.0/diskmodel/tests'
> make[1]: Leaving directory `/home/bpayne/disksim-4.0/diskmodel'
> make -C memsmodel
> make[1]: Entering directory `/home/bpayne/disksim-4.0/memsmodel'
> gcc -Wall -Wno-unused -MD -g -DASSERTS  -I../src// -I../ -I../src//src   -c -o mems_disksim.o mems_disksim.c
> gcc -Wall -Wno-unused -MD -g -DASSERTS  -I../src// -I../ -I../src//src   -c -o mems_event.o mems_event.c
> gcc -Wall -Wno-unused -MD -g -DASSERTS  -I../src// -I../ -I../src//src   -c -o mems_mapping.o mems_mapping.c
> gcc -Wall -Wno-unused -MD -c -g -DASSERTS  -I../src// -I../
> -I../src//src mems_buffer.c -o mems_buffer.o ar cru libmemsmodel.a
> mems_disksim.o mems_event.o mems_mapping.o mems_internals.o
> mems_piecewise_seek.o mems_hong_seek.o mems_buffer.o
> modules/memsmodel_mems_param.o ranlib libmemsmodel.a mkdir -p lib cp
> -p libmemsmodel.a lib
> make[1]: Leaving directory `/home/bpayne/disksim-4.0/memsmodel'
> make -C src
> make[1]: Entering directory `/home/bpayne/disksim-4.0/src'
> make -C modules
> make[2]: Entering directory `/home/bpayne/disksim-4.0/src/modules'
> ../../libparam/mod.pl disksim bus.modspec indent disksim_bus_param.c
> || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_bus_param.o disksim_bus_param.c
> ../../libparam/mod.pl disksim ctlr.modspec indent disksim_ctlr_param.c
> || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_ctlr_param.o disksim_ctlr_param.c
> disksim_ctlr_param.c: In function 'DISKSIM_CTLR_SCHEDULER_loader':
> disksim_ctlr_param.c:64:24: warning: cast to pointer from integer of
> different size [-Wint-to-pointer-cast] ../../libparam/mod.pl disksim
> iodriver.modspec indent disksim_iodriver_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_iodriver_param.o disksim_iodriver_param.c
> disksim_iodriver_param.c: In function 'DISKSIM_IODRIVER_SCHEDULER_loader':
> disksim_iodriver_param.c:42:24: warning: cast to pointer from integer
> of different size [-Wint-to-pointer-cast] ../../libparam/mod.pl
> disksim ioqueue.modspec indent disksim_ioqueue_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_ioqueue_param.o disksim_ioqueue_param.c
> ../../libparam/mod.pl disksim disk.modspec indent disksim_disk_param.c
> || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_disk_param.o disksim_disk_param.c
> disksim_disk_param.c: In function 'DISKSIM_DISK_MODEL_loader':
> disksim_disk_param.c:9:24: warning: cast to pointer from integer of
> different size [-Wint-to-pointer-cast]
> disksim_disk_param.c: In function 'DISKSIM_DISK_SCHEDULER_loader':
> disksim_disk_param.c:19:25: warning: cast to pointer from integer of
> different size [-Wint-to-pointer-cast]
> disksim_disk_param.c: In function 'DISKSIM_DISK_USE_SEPARATE_WRITE_SEGMENT_loader':
> disksim_disk_param.c:241:30: warning: cast to pointer from integer of
> different size [-Wint-to-pointer-cast] ../../libparam/mod.pl disksim
> simpledisk.modspec indent disksim_simpledisk_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_simpledisk_param.o disksim_simpledisk_param.c
> disksim_simpledisk_param.c: In function 'DISKSIM_SIMPLEDISK_SCHEDULER_loader':
> disksim_simpledisk_param.c:9:24: warning: cast to pointer from integer
> of different size [-Wint-to-pointer-cast] ../../libparam/mod.pl
> disksim device_stats.modspec indent disksim_device_stats_param.c ||
> true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_device_stats_param.o disksim_device_stats_param.c
> ../../libparam/mod.pl disksim bus_stats.modspec indent
> disksim_bus_stats_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_bus_stats_param.o disksim_bus_stats_param.c
> ../../libparam/mod.pl disksim ctlr_stats.modspec indent
> disksim_ctlr_stats_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_ctlr_stats_param.o disksim_ctlr_stats_param.c
> ../../libparam/mod.pl disksim iodriver_stats.modspec indent
> disksim_iodriver_stats_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_iodriver_stats_param.o disksim_iodriver_stats_param.c
> ../../libparam/mod.pl disksim pf_stats.modspec indent
> disksim_pf_stats_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_pf_stats_param.o disksim_pf_stats_param.c
> ../../libparam/mod.pl disksim global.modspec indent
> disksim_global_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_global_param.o disksim_global_param.c
> ../../libparam/mod.pl disksim stats.modspec indent
> disksim_stats_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_stats_param.o disksim_stats_param.c
> ../../libparam/mod.pl disksim syncset.modspec indent
> disksim_syncset_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_syncset_param.o disksim_syncset_param.c
> ../../libparam/mod.pl disksim synthgen.modspec indent
> disksim_synthgen_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_synthgen_param.o disksim_synthgen_param.c
> ../../libparam/mod.pl disksim synthio.modspec indent
> disksim_synthio_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_synthio_param.o disksim_synthio_param.c
> ../../libparam/mod.pl disksim logorg.modspec indent
> disksim_logorg_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_logorg_param.o disksim_logorg_param.c
> ../../libparam/mod.pl disksim pf.modspec indent disksim_pf_param.c ||
> true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_pf_param.o disksim_pf_param.c
> ../../libparam/mod.pl disksim cachemem.modspec indent
> disksim_cachemem_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_cachemem_param.o disksim_cachemem_param.c
> ../../libparam/mod.pl disksim cachedev.modspec indent
> disksim_cachedev_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_cachedev_param.o disksim_cachedev_param.c
> ../../libparam/mod.pl disksim device.modspec indent
> disksim_device_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_device_param.o disksim_device_param.c
> ../../libparam/mod.pl disksim iosim.modspec indent
> disksim_iosim_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_iosim_param.o disksim_iosim_param.c
> ../../libparam/mod.pl disksim iomap.modspec indent
> disksim_iomap_param.c || true
> /bin/sh: 1: indent: not found
> cc -g -I../../libddbg/include -I../../libparam/include -I../../diskmodel/include -I..   -c -o disksim_iomap_param.o disksim_iomap_param.c
> ../../libparam/make_modules_h.pl disksim *.modspec > modules.h
> make[2]: Leaving directory `/home/bpayne/disksim-4.0/src/modules'
> mkdir -p ../include/disksim/modules
> cp -pR modules/*.h ../include/disksim/modules cp disksim_interface.h ../include
> gcc -Wall -Wno-unused -MD -c -I. -I../diskmodel/include -I../libparam/include -I../libddbg/include -g -DASSERTS   -I../memsmodel/include -D_INLINE  disksim.c -o disksim.o
> disksim.c: In function 'disksim_cleanup':
> disksim.c:1086:3: warning: implicit declaration of function 'iodriver_cleanup' [-Wimplicit-function-declaration]
> gcc -Wall -Wno-unused -MD -c -I. -I../diskmodel/include -I../libparam/include -I../libddbg/include -g -DASSERTS   -I../memsmodel/include -D_INLINE  disksim_intr.c -o disksim_intr.o
> gcc -Wall -Wno-unused -MD -c -I. -I../diskmodel/include -I../libparam/include -I../libddbg/include -g -DASSERTS   -I../memsmodel/include -D_INLINE  disksim_pfsim.c -o disksim_pfsim.o
> gcc -Wall -Wno-unused -MD -c -I. -I../diskmodel/include -I../libparam/include -I../libddbg/include -g -DASSERTS   -I../memsmodel/include -D_INLINE  disksim_pfdisp.c -o disksim_pfdisp.o
> gcc -Wall -Wno-unused -MD -c -I. -I../diskmodel/include -I../libparam/include -I../libddbg/include -g -DASSERTS   -I../memsmodel/include -D_INLINE  disksim_synthio.c -o disksim_synthio.o
> disksim_synthio.c: In function 'synthio_appendio':
> disksim_synthio.c:215:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> gcc -Wall -Wno-unused -MD -c -I. -I../diskmodel/include -I../libparam/include -I../libddbg/include -g -DASSERTS   -I../memsmodel/include -D_INLINE  disksim_iotrace.c -o disksim_iotrace.o
> disksim_iotrace.c: In function 'iotrace_hpl_get_ioreq_event':
> disksim_iotrace.c:373:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> gcc -Wall -Wno-unused -MD -c -I. -I../diskmodel/include -I../libparam/include -I../libddbg/include -g -DASSERTS   -I../memsmodel/include -D_INLINE  disksim_iosim.c -o disksim_iosim.o
> disksim_iosim.c: In function 'iosim_load_map':
> disksim_iosim.c:364:17: warning: cast to pointer from integer of
> different size [-Wint-to-pointer-cast]
> disksim_iosim.c: In function 'io_initialize':
> disksim_iosim.c:712:4: error: duplicate case value
> disksim_iosim.c:712:4: error: previously used here
> make[1]: *** [disksim_iosim.o] Error 1
> make[1]: Leaving directory `/home/bpayne/disksim-4.0/src'
> make: *** [all] Error 2
>
>
>
> Thank you,
>
>
> Ben Payne
> http://mst.edu/~bhpxc9/
> Suite 450, Room S452
> 5520 Research Park Drive
> Catonsville, MD 21228-4870
> Laboratory for Physical Sciences
> http://www.lps.umd.edu/
> office: 443-654-7890
> cell: 608-308-2413
>
>
> _______________________________________________
> Disksim-users mailing list
> Disksim-users at ece.cmu.edu
> https://sos.ece.cmu.edu/mailman/listinfo/disksim-users
> _______________________________________________
> Disksim-users mailing list
> Disksim-users at ece.cmu.edu
> https://sos.ece.cmu.edu/mailman/listinfo/disksim-users




More information about the Disksim-users mailing list