Page 1 of 1

SSE2 instruction set problem

Posted: Mon Mar 19, 2018 9:24 am
by Joszif
Hello!

We have an application, that uses FiveWin, but it can not be executed on specific computers.
We found the source of the problem: the applications assembly code contains commands of SSE2 instruction set, so it can not be executed on CPUs, that doesn't support SSE2 instruction set.

(Pictures of our application's assembly code)
Image

Image

We found the code, that is in the hbvm.lib.
This file is part of the Harbour package, that we've got when we've purchased FiveWin.

(Picture of hbvm.lib file)
Image

We would like to rebuild these Harbour lib files, so that they will not contain commands of SSE/SSE2 instruction sets.
The Visual Studio compiler have a cl.exe option: /arch, that could be used (https://msdn.microsoft.com/en-us/library/7t5yh4fd.aspx),
but we haven't got the source of the Harbour lib files, that we got with the FiveWin package.


Can we have a new compilation of the Harbour lib files, without SSE/SSE2 instruction set command?


(We use FWH 17.11, with Harbour 3.2.)

Re: SSE2 instruction set problem

Posted: Mon Mar 19, 2018 9:59 am
by Antonio Linares
Joszif,

The Harbour sources are available from here:
https://github.com/harbour/core

What C compiler are you using to build your apps ?

Re: SSE2 instruction set problem

Posted: Mon Mar 19, 2018 12:14 pm
by Joszif
Dear Antonio,

We use Visual Studio 2017 compiler (Exact version: 19.11.25547 for x86).

When we purchased FiveWin, we got compiled Harbour lib files, in a zip file, named Harbour_vsc2017_32bits_20170325.zip.
This zip contains every Harbour lib files, including the hbvm.lib file that we mentioned in the previous post.

The Harbour version that can be downloaded from the official site, was not good for us, because it threw the following linker error:
error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1900' in [filename].OBJ.

I think the solution is a new Harbour_vsc2017_32bits_20170325.zip that is made by using /arch compiler option.

What do you think about it?

Thank you,

Joszif

Re: SSE2 instruction set problem

Posted: Mon Mar 19, 2018 1:17 pm
by AntoninoP
I think your only possibility is download and compile harbour yourself, with visual studio it is pretty simple: start the "developer-command-prompt" and run "win-make.exe" in the harbour root.
In your case you must modify the file config\win\msvc.mk where sets up th CFLAGS and/or the LDFLAGS
Just for curiosity, which processor your program needs to run on? the SS2 is from 2000, and now they are in every system...

Re: SSE2 instruction set problem

Posted: Mon Mar 19, 2018 6:43 pm
by Antonio Linares
Joszif,

> error LNK2038: mismatch detected for '_MSC_VER': value '1600' doesn't match value '1900' in [filename].OBJ.

Please copy here the complete error. I don't find any filename.* file in the harbour sources

> I think the solution is a new Harbour_vsc2017_32bits_20170325.zip that is made by using /arch compiler option.

You call pull the Harbour sources from 2017/03/25 from Github

Re: SSE2 instruction set problem

Posted: Tue Mar 20, 2018 2:51 pm
by Joszif
Hello,

Thank you for your help, the problem has been solved.

We downloaded the Harbour core from github as Antonio suggested and then we rebuilt the source as AntonioP suggested.
These newly created lib files don't contain SSE2 specific commands.

Anyway, there are computers in our network that has old, mostly AMD processors, that don't support SSE2.

Thank you for your help!

Joszif

Re: SSE2 instruction set problem

Posted: Tue Mar 20, 2018 7:13 pm
by Antonio Linares
Joszif,

Glad to know that you solved it :-)