numediart / MBROLA

MBROLA is a speech synthesizer based on the concatenation of diphones
GNU Affero General Public License v3.0
234 stars 57 forks source link

Problem compiling on MacOS #9

Open glocq opened 5 years ago

glocq commented 5 years ago

Trying to compile on MacOS High Sierra 10.13.6 using make results in an error:

In file included from Standalone/synth.c:41:
Misc/common.h:70:6: error: conflicting types for 'swab'
void swab( const char *from, char *to, int nbytes);
     ^
/usr/include/unistd.h:600:10: note: previous declaration is here
void     swab(const void * __restrict, void * __restrict, ssize_t);
         ^

I did uncomment CFLAGS += -DTARGET_OS_MAC as specified in README_Makefile.md.

GHPS commented 5 years ago

Strange - chengdu was able to compile mbrola on MacOS 64 Bit (see https://github.com/numediart/MBROLA/issues/3#issuecomment-452546647_ )

1) The cause of the warning is that the swab function is defined twice. What happens if you comment out the swab function in Misc/common.h? Do you still get the compile error? 2) I checked the parts of the code where the compiler directive TARGET_OS_MAC is used. It's only reason is to enable the swab-function. So simply commenting the CFLAGS line out - again - should do the job.

setrar commented 4 years ago
  1. The cause of the warning is that the swab function is defined twice. What happens if you comment out the swab function in Misc/common.h? Do you still get the compile error?

No, it's going through :tada:

% git diff Misc/common.h
diff --git a/Misc/common.h b/Misc/common.h
index 0357db4..e32b898 100644
--- a/Misc/common.h
+++ b/Misc/common.h
@@ -71,7 +71,7 @@

 /* For beboxes and Mac use a hand-made version of swab */
 #if defined(TARGET_OS_VMS) || defined(TARGET_OS_BEOS) || defined(TARGET_OS_MAC) || defined(__STRICT_ANSI__)
-void swab( const char *from, char *to, int nbytes);
+//void swab( const char *from, char *to, int nbytes);
 #endif

 #if defined(__GLIBC__)
  1. I checked the parts of the code where the compiler directive TARGET_OS_MAC is used. It's only reason is to enable the swab-function. So simply commenting the CFLAGS line out - again - should do the job.

No, I didn't comment it out otherwise I get an error in common.c

Misc/common.c:32:6: error: conflicting types for 'swab'
void swab( const char *from, char *to, int nbytes)
setrar commented 4 years ago

A bit frustrated, I tried to compile the project under Multipass with Ubuntu Linux on MacOS.

I was able to compile following the documentation and was also able to create my first wave file.

$ Bin/mbrola -i ../MBROLA-voices/data/ca1/ca1 \
                          ../MBROLA-voices/data/ca1/test/merci.pho merci.wav

I then copied the file back onto the Mac

% sudo scp -i /var/root/Library/Application\ Support/multipassd/ssh-keys/id_rsa \
             multipass@192.168.64.4:MBROLA/merci.wav .

And it played only with Audacity and Garage Band but iTunes Music coudn't play the sound file, same noise issue.

Great projet! :tada:

valdisvi commented 3 years ago

Check out, if this fixes issue.